2016-07-12 17:25:46 +05:00
|
|
|
from __future__ import absolute_import
|
2014-07-23 21:12:54 -07:00
|
|
|
from setuptools import setup, find_packages
|
2016-07-11 16:03:03 +05:00
|
|
|
from setuptools.command.install import install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class InstallCommand(install):
|
|
|
|
|
user_options = install.user_options + [
|
2022-11-12 10:13:46 +01:00
|
|
|
("no-ml", None, "Don't install without Machine Learning modules."),
|
2016-07-11 16:03:03 +05:00
|
|
|
]
|
|
|
|
|
|
2022-11-12 10:13:46 +01:00
|
|
|
boolean_options = install.boolean_options + ["no-ml"]
|
2016-07-11 16:03:03 +05:00
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
|
install.initialize_options(self)
|
|
|
|
|
self.no_ml = None
|
|
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
|
install.finalize_options(self)
|
|
|
|
|
if self.no_ml:
|
|
|
|
|
dist = self.distribution
|
2022-11-12 10:13:46 +01:00
|
|
|
dist.packages = find_packages(
|
|
|
|
|
exclude=[
|
|
|
|
|
"tests",
|
|
|
|
|
"tests.*",
|
|
|
|
|
"talon.signature",
|
|
|
|
|
"talon.signature.*",
|
|
|
|
|
]
|
|
|
|
|
)
|
2021-04-27 09:27:24 -05:00
|
|
|
for not_required in ["numpy", "scipy", "scikit-learn==0.24.1"]:
|
2016-07-11 16:03:03 +05:00
|
|
|
dist.install_requires.remove(not_required)
|
2014-07-23 21:12:54 -07:00
|
|
|
|
|
|
|
|
|
2022-11-12 10:13:46 +01:00
|
|
|
setup(
|
|
|
|
|
name="talon-o2w",
|
|
|
|
|
version="1.6.1",
|
|
|
|
|
description=(
|
|
|
|
|
"Mailgun library " "to extract message quotations and signatures."
|
|
|
|
|
),
|
|
|
|
|
long_description=open("README.rst").read(),
|
|
|
|
|
author="Mailgun Inc.",
|
|
|
|
|
author_email="admin@mailgunhq.com",
|
|
|
|
|
url="https://github.com/mailgun/talon",
|
|
|
|
|
license="APACHE2",
|
|
|
|
|
cmdclass={
|
|
|
|
|
"install": InstallCommand,
|
|
|
|
|
},
|
|
|
|
|
packages=find_packages(exclude=["tests", "tests.*"]),
|
|
|
|
|
include_package_data=True,
|
|
|
|
|
zip_safe=True,
|
|
|
|
|
install_requires=[
|
|
|
|
|
"lxml",
|
|
|
|
|
"regex",
|
|
|
|
|
"numpy",
|
|
|
|
|
"scipy",
|
|
|
|
|
"scikit-learn>=1.0.0",
|
|
|
|
|
"chardet",
|
|
|
|
|
# "cchardet",
|
|
|
|
|
"cssselect",
|
|
|
|
|
"six",
|
|
|
|
|
"html5lib",
|
|
|
|
|
"joblib",
|
|
|
|
|
],
|
|
|
|
|
tests_require=["mock", "nose", "coverage"],
|
|
|
|
|
)
|