-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
71 lines (61 loc) · 2.4 KB
/
setup.py
File metadata and controls
71 lines (61 loc) · 2.4 KB
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
import re
from pathlib import Path
from setuptools import setup, find_packages
PROJECT_ROOT_PATH = Path(__file__).parent
VERSION_FILE_PATH = PROJECT_ROOT_PATH / 'aito' / '__init__.py'
REQUIREMENTS_FILE_PATH = PROJECT_ROOT_PATH / 'requirements' / 'build.txt'
def find_current_version(version_file_path: Path) -> str:
with version_file_path.open() as f:
init_content = f.read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", init_content, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def fetch_requirements(requirements_file_path: Path):
requirements = []
with requirements_file_path.open() as in_f:
for line in in_f:
requirements.append(line.strip())
return requirements
with (PROJECT_ROOT_PATH / 'README.rst').open() as f:
long_description = f.read()
setup(
name='aitoai',
version=find_current_version(VERSION_FILE_PATH),
author='aito.ai',
author_email='admin@aito.ai',
description='Aito.ai Python SDK',
long_description=long_description,
long_description_content_type="text/x-rst",
url='https://github.com/AitoDotAI/aito-python-tools',
project_urls={
'Documentation': 'https://aito-python-sdk.readthedocs.io/en/latest/',
'Source': 'https://github.com/AitoDotAI/aito-python-tools',
'Tracker': 'https://github.com/AitoDotAI/aito-python-tools/issues',
},
packages=find_packages(exclude=['tests', 'tests.*']),
install_requires=fetch_requirements(REQUIREMENTS_FILE_PATH),
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: POSIX :: BSD',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
python_requires='>=3.9',
entry_points={
'console_scripts': [
'aito = aito.cli.main_parser:main'
]
}
)