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