Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
GRAAL-Research
GitHub Repository: GRAAL-Research/deepparse
Path: blob/main/setup.py
1231 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
"Programming Language :: Python :: 3.12",
66
"Programming Language :: Python :: 3.13",
67
"Programming Language :: Python :: 3.14",
68
"Topic :: Software Development :: Libraries",
69
"Topic :: Software Development :: Libraries :: Python Modules",
70
"Topic :: Scientific/Engineering",
71
"Topic :: Scientific/Engineering :: Artificial Intelligence",
72
],
73
packages=packages,
74
install_requires=[
75
"numpy<2.0.0",
76
"torch",
77
"bpemb",
78
"scipy",
79
"gensim>=4.3.3",
80
"requests",
81
"fasttext-wheel",
82
"pymagnitude-light",
83
"poutyne",
84
"pandas",
85
"urllib3",
86
"cloudpathlib[s3, gs, azure]",
87
"transformers",
88
"huggingface_hub",
89
],
90
python_requires=">=3.8",
91
description="A library for parsing multinational street addresses using deep learning.",
92
long_description=readme,
93
long_description_content_type="text/markdown",
94
extras_require={
95
"colorama": "colorama",
96
"app": ["fastapi[all]>=0.109.1", "uvicorn==0.22.0", "sentry-sdk[fastapi]>=2.0.0", "python-decouple==3.8"],
97
"all": [
98
"colorama", # colorama
99
"fastapi[all]>=0.109.1", # app requirements
100
"uvicorn==0.22.0",
101
"sentry-sdk[fastapi]>=2.0.0",
102
"python-decouple==3.8",
103
"black", # code formatting requirements
104
"pylint",
105
"pylint-django[with_django]==2.5.3",
106
"pre-commit==3.3.3",
107
"pycountry==22.3.5", # tests requirements
108
"pytest",
109
"pytest-asyncio",
110
"pytest_cov",
111
"pytest-env",
112
"pytest-mock",
113
"pytest-xdist[psutil]",
114
"tensorboard==2.13.0",
115
"sphinx==6.2.1", # documentation requirements
116
"sphinx_rtd_theme==1.2.2",
117
],
118
},
119
)
120
121
122
if __name__ == "__main__":
123
main()
124
125