|
| 1 | +import os |
1 | 2 | import re |
2 | 3 | from setuptools import find_packages, setup |
3 | | -from mindee.versions import __version__ |
4 | 4 |
|
| 5 | +dir_path = os.path.dirname(os.path.realpath(__file__)) |
| 6 | +with open(os.path.join(dir_path, "mindee", "version"), "r") as version_file: |
| 7 | + __version__ = version_file.read().strip() |
5 | 8 |
|
6 | 9 | with open("README.md", "r", newline="", encoding="utf-8") as fh: |
7 | 10 | long_description = fh.read() |
|
12 | 15 | GIT_URL = "https://github.com/publicMindee/mindee-api-python" |
13 | 16 |
|
14 | 17 |
|
15 | | -def make_requirements_list(file="requirements.txt", only_regular=True): |
16 | | - """ |
17 | | - Make a list of package requirements from a requirements.txt file |
18 | | - :param file: path to txt file |
19 | | - :param only_regular: remove rows with /, #, space or empty |
20 | | - :return: |
21 | | - """ |
22 | | - with open(file) as f: |
23 | | - lines = f.read().splitlines() |
24 | | - if only_regular: |
25 | | - regex = ( |
26 | | - "\/$|^#|^$$|^git\+" # remove line with /, starting by # or space or empty |
27 | | - ) |
28 | | - return [line for line in lines if not re.findall(regex, line)] |
29 | | - else: |
30 | | - return lines |
| 18 | +requirements = [ |
| 19 | + "requests==2.25.1", |
| 20 | + "pytz==2021.3", |
| 21 | + "PyMuPDF==1.18.17", |
| 22 | +] |
31 | 23 |
|
| 24 | +test_requirements = [ |
| 25 | + "pytest==6.1.2", |
| 26 | + "pytest-cov==2.11.1", |
| 27 | +] |
| 28 | + |
| 29 | +dev_requirements = [ |
| 30 | + "black==21.12b0", |
| 31 | + "setuptools==49.2.0", |
| 32 | + "pip-tools==6.4.0", |
| 33 | +] |
32 | 34 |
|
33 | 35 | setup( |
34 | 36 | python_requires=">=3.6", |
35 | | - name=f"{PACKAGE_NAME}", |
36 | | - description="Mindee API helper library for python", |
| 37 | + name=PACKAGE_NAME, |
| 38 | + description="Mindee API helper library for Python", |
37 | 39 | version=__version__, |
38 | 40 | long_description=long_description, |
39 | 41 | long_description_content_type="text/markdown", |
40 | 42 | url=GIT_URL, |
41 | 43 | packages=find_packages(), |
42 | 44 | author="Mindee", |
43 | 45 | author_email="devrel@mindee.com", |
44 | | - install_requires=make_requirements_list(), |
| 46 | + install_requires=requirements, |
| 47 | + extras_require={ |
| 48 | + "dev": dev_requirements, |
| 49 | + "test": test_requirements, |
| 50 | + }, |
45 | 51 | include_package_data=True, |
| 52 | + package_data={"mindee": ["version"]}, |
| 53 | + classifiers=[ |
| 54 | + "Programming Language :: Python :: 3", |
| 55 | + "Operating System :: OS Independent", |
| 56 | + "Development Status :: 5 - Production/Stable", |
| 57 | + "Intended Audience :: Developers", |
| 58 | + "Topic :: Software Development :: Libraries", |
| 59 | + ], |
46 | 60 | ) |
0 commit comments