-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup.py
95 lines (84 loc) · 2.34 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
from setuptools import setup, find_packages
from pathlib import Path
from typing import List
import sys
import re
import os
ROOT_PATH = Path(os.path.dirname(os.path.abspath(__file__))).resolve()
REQUIREMENTS_PATH = Path(
ROOT_PATH,
os.path.join(
"dev_tools",
"requirements",
"gc-venv-current.txt"
)
)
DEV_REQUIREMENTS_PATH = Path(
ROOT_PATH,
os.path.join(
"dev_tools",
"requirements",
"dev-requirements.txt",
)
)
CI_REQUIREMENTS_PATH = Path(
ROOT_PATH,
os.path.join(
"dev_tools",
"requirements",
"ci-requirements.txt",
)
)
CDVID19_REQUIREMENTS_PATH = Path(
ROOT_PATH,
os.path.join(
"dev_tools",
"requirements",
"covid-19-dev-requirements.txt",
)
)
def parse_requirements(requirements: Path) -> List[str]:
with requirements.open(mode="r") as fd:
rlist_sans_comments = [
line.strip()
for line in fd.read().split("\n")
if (line.strip() or line.strip().startswith("#"))
]
final_rlist = [
line
if not re.match(
pattern=r"^https?://.*$",
string=line)
else re.sub(
pattern=r"(.*(?:https?://.*/)([a-zA-Z0-9_].*)[-]([a-zA-Z0-9.]*)([.]tar[.]gz|[.]tgz).*)",
repl=r"\2 @ \1",
string=line
)
for line in rlist_sans_comments
]
return final_rlist
setup(
name='gamechanger',
version='evergreen',
packages=find_packages(),
url='https://bitbucket.di2e.net/projects/UOT/repos/gamechanger',
author='gamechanger@advana',
install_requires=list(filter(
lambda p: not (p.lower().startswith('faiss-gpu') and sys.platform != 'linux'),
parse_requirements(REQUIREMENTS_PATH)
)),
extras_require={
"dev": parse_requirements(DEV_REQUIREMENTS_PATH),
"ci": parse_requirements(CI_REQUIREMENTS_PATH),
"covid-dev": parse_requirements(CDVID19_REQUIREMENTS_PATH),
},
python_requires="==3.8.*",
entry_points = {
'console_scripts': [
'composectl=dev.composectl.__main__:main',
'configuration=configuration.__main__:main',
'gci=dataPipelines.gc_ingest.__main__:cli',
'uni=dev.universal_test_harness.__main__:cli'
]
}
)