-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
44 lines (37 loc) · 1.28 KB
/
setup.py
File metadata and controls
44 lines (37 loc) · 1.28 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
from collections import defaultdict
from setuptools import setup
def get_extra_requires(path, add_all=True):
"""
Get additional installation requirements from an external requirements.txt file.
Note: This code was taken from Han Xiao
https://hanxiao.io/2019/11/07/A-Better-Practice-for-Managing-extras-require-Dependencies-in-Python/
"""
with open(path) as fp:
extra_deps = defaultdict(set)
for k in fp:
if k.strip() and not k.startswith('#'):
tags = set()
if ':' in k:
k, v = k.split(':')
tags.update(vv.strip() for vv in v.split(','))
for t in tags:
extra_deps[t].add(k.strip())
# add tag `all` at the end
if add_all:
extra_deps['all'] = {vv for v in extra_deps.values() for vv in v}
return extra_deps
# Adding the dependencies here for GitHub
setup(
name="pyDAS",
install_requires=[
"alembic==1.4.3",
"blinker==1.4",
"dependency-injector[yaml]==4.36.2",
"Flask==1.1.2",
"Flask-Cors==3.0.8",
"flask-swagger-ui==3.25.0",
"requests==2.24.0",
"SQLAlchemy==1.4.26"
],
extras_require=get_extra_requires('extra-requirements.txt')
)