-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
111 lines (101 loc) · 3.3 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
"""Setup."""
import subprocess
import sys
import textwrap
from os import getenv, path
import setuptools
from konfuzio_sdk_extras_list import EXTRAS
# Define version or calculate it for nightly build.
#
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
#
# Generic release markers:
# X.Y.0 # For first release after an increment in Y
# X.Y.Z # For bugfix releases
#
# Admissible pre-release markers:
# X.Y.ZaN # Alpha release
# X.Y.ZbN # Beta release
# X.Y.ZrcN # Release Candidate
# X.Y.Z # Final release
#
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
#
with open(path.join('konfuzio_sdk', 'VERSION')) as version_file:
version_number = version_file.read().strip()
if getenv('NIGHTLY_BUILD'):
# create a pre-release
last_commit = (
subprocess.check_output(['git', 'log', '-1', '--pretty=%cd', '--date=format:%Y%m%d%H%M%S'])
.decode('ascii')
.strip()
)
version = f'{version_number}.dev{last_commit}'
else:
version = f'{version_number}'
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 7)
if CURRENT_PYTHON < REQUIRED_PYTHON:
sys.stderr.write(
textwrap.dedent(
f"""
==========================
Unsupported Python version
==========================
This version of Konfuzio SDK requires Python {REQUIRED_PYTHON}, but you're trying to
install it on Python {CURRENT_PYTHON}.
"""
)
)
sys.exit(1)
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setuptools.setup(
name='konfuzio_sdk',
version=version,
author='Helm & Nagel GmbH',
author_email='info@helm-nagel.com',
description='Konfuzio Software Development Kit',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/konfuzio-ai/konfuzio-sdk/',
packages=[
'konfuzio_sdk',
'konfuzio_sdk.bento',
'konfuzio_sdk.bento.base',
'konfuzio_sdk.bento.extraction',
'konfuzio_sdk.bento.categorization',
'konfuzio_sdk.tokenizer',
'konfuzio_sdk.trainer',
],
py_modules=['konfuzio_sdk_extras_list'],
include_package_data=True,
entry_points={'console_scripts': ['konfuzio_sdk=konfuzio_sdk.cli:main']},
install_requires=[
'bentoml==1.2.18',
'fastapi<0.111.0', # Used to serve additional endpoints in Bento services
'certifi==2023.7.22',
'cloudpickle==2.2.1', # Used to pickle objects
'filetype==1.0.7', # Used to check that files are in the correct format
'lz4>=4.3.2', # Used to compress pickles
'matplotlib==3.7.1',
'nltk>=3.6.3,<3.8.2',
'numpy==1.23.5',
'pandas>=1.3.5,<2.0.0',
'Pillow>=8.4.0',
'pydantic>2,<2.8',
'python-dateutil>=2.8.2',
'python-decouple>=3.3',
'python-dotenv>=1.0,<1.1',
'requests',
'regex>=2020.6.8', # re module but better
'scikit-learn==1.2.2',
'tabulate>=0.9.0', # Used to pretty print DataFrames
'tqdm>=4.64.0',
'pympler>=1.0.1', # Use to get pickle file size.
],
extras_require=EXTRAS,
)