-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathsetup.py
118 lines (102 loc) · 4.04 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import os
import subprocess
from setuptools import setup, find_packages
current_file_path = os.path.abspath(os.path.dirname(__file__))
def get_readme():
readme_file_path = os.path.join(current_file_path, "README.md")
with open(readme_file_path, "r", encoding="utf-8") as f:
return f.read()
def get_version():
version_file_path = os.path.join(current_file_path, "version.txt")
with open(version_file_path, "r", encoding="utf-8") as f:
version = f.read().strip()
try:
sha = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip()
except Exception: # pylint: disable=broad-except
sha = "Unknown"
if os.getenv("DEEPPARSE_RELEASE_BUILD") != "1":
version += ".dev1"
if sha != "Unknown":
version += "+" + sha[:7]
return version
def write_version_python_file(version):
version_python_file = os.path.join(current_file_path, "deepparse", "version.py")
with open(version_python_file, "w", encoding="utf-8") as f:
f.write(f"__version__ = {repr(version)}\n")
def main():
readme = get_readme()
version = get_version()
print("Building version", version)
write_version_python_file(version)
packages = find_packages()
setup(
name="deepparse",
version=version,
author="Marouane Yassine, David Beauchemin",
author_email="[email protected], [email protected]",
url="https://deepparse.org/",
download_url="https://github.com/GRAAL-Research/deepparse/archive/v" + version + ".zip",
license="LGPLv3",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
packages=packages,
install_requires=[
"numpy<2.0.0",
"torch",
"bpemb",
"scipy",
"gensim>=4.3.3",
"requests",
"fasttext-wheel",
"pymagnitude-light",
"poutyne",
"pandas",
"urllib3",
"cloudpathlib[s3, gs, azure]",
],
python_requires=">=3.8",
description="A library for parsing multinational street addresses using deep learning.",
long_description=readme,
long_description_content_type="text/markdown",
extras_require={
"colorama": "colorama",
"app": ["fastapi[all]>=0.109.1", "uvicorn==0.22.0", "sentry-sdk[fastapi]>=2.0.0", "python-decouple==3.8"],
"all": [
"colorama", # colorama
"fastapi[all]>=0.109.1", # app requirements
"uvicorn==0.22.0",
"sentry-sdk[fastapi]>=2.0.0",
"python-decouple==3.8",
"black", # code formatting requirements
"pylint",
"pylint-django[with_django]==2.5.3",
"pre-commit==3.3.3",
"pycountry==22.3.5", # tests requirements
"pytest",
"pytest-asyncio",
"pytest_cov",
"pytest-env",
"pytest-mock",
"pytest-xdist[psutil]",
"tensorboard==2.13.0",
"sphinx==6.2.1", # documentation requirements
"sphinx_rtd_theme==1.2.2",
],
},
)
if __name__ == "__main__":
main()