forked from viur-framework/viur-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
21 lines (18 loc) · 817 Bytes
/
setup.py
File metadata and controls
21 lines (18 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import setuptools
# Read all requirements with versions from requirements.txt
requirements = {}
for line in open("requirements.txt").readlines():
if "==" not in line or line.strip().startswith("#"):
continue
line = line.split("--hash", maxsplit=1)[0].strip(" \t\\\r\n").split("==", 1)
requirements[line[0]] = line[1]
# Check for "[grpc]" packages and remove the non-"[grpc]"-version of them
for req in list(requirements.keys()):
if (pos := req.find("[grpc]")) > 0:
if req[:pos] in requirements:
del requirements[req[:pos]]
setuptools.setup(
package_dir={'viur': '.'},
packages=[f'viur.{mod}' for mod in setuptools.find_packages('.', exclude=('tests*',))],
install_requires=[f"{k}=={v}" for k, v in sorted(requirements.items(), key=lambda k: k[0].lower())]
)