-
Notifications
You must be signed in to change notification settings - Fork 26
/
setup.py
executable file
·54 lines (48 loc) · 1.83 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
#!python
# builtin
import setuptools
import re
# local
import alphatims as package2install
with open("README.md", "r") as readme_file:
LONG_DESCRIPTION = readme_file.read()
extra_requirements = {}
for extra, requirement_file_name in package2install.__requirements__.items():
with open(requirement_file_name) as requirements_file:
if extra != "":
extra_stable = f"{extra}-stable"
else:
extra_stable = "stable"
extra_requirements[extra_stable] = []
extra_requirements[extra] = []
for line in requirements_file:
extra_requirements[extra_stable].append(line)
# conditional req like: "pywin32; sys_platform=='win32'"
line, *conditions = line.split(';')
requirement, *comparison = re.split("[><=~!]", line)
requirement == requirement.strip()
requirement = ";".join([requirement] + conditions)
extra_requirements[extra].append(requirement)
requirements = extra_requirements.pop("")
setuptools.setup(
name=package2install.__project__,
version=package2install.__version__,
license=package2install.__license__,
description=package2install.__description__,
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
author=package2install.__author__,
author_email=package2install.__author_email__,
url=package2install.__github__,
project_urls=package2install.__urls__,
keywords=package2install.__keywords__,
classifiers=package2install.__classifiers__,
packages=[package2install.__project__],
include_package_data=True,
entry_points={
"console_scripts": package2install.__console_scripts__,
},
install_requires=requirements,
extras_require=extra_requirements,
python_requires=package2install.__python_version__,
)