forked from localstack/localstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·63 lines (50 loc) · 1.68 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
#!/usr/bin/env python
import re
from collections import defaultdict
from plugin.setuptools import load_entry_points
from setuptools import find_packages, setup
def parse_requirements(lines):
requirements = defaultdict(list)
extra = "install"
for line in lines:
line = line.strip()
if line.startswith("# extra="):
# all subsequent lines are associated with this extra, until a new extra appears
extra = line.split("=")[1]
continue
if line and line[0] == "#" and "#egg=" in line:
line = re.search(r"#\s*(.*)", line).group(1)
if line and line[0] != "#":
lib_stripped = line.split(" #")[0].strip()
requirements[extra].append(lib_stripped)
return requirements
# define package data
package_data = {
"": ["Makefile", "*.md"],
"localstack": [
"package.json",
"requirements*.txt",
"utils/kinesis/java/cloud/localstack/*.*",
],
}
# determine requirements
with open("requirements.txt") as f:
req = parse_requirements(f.readlines())
install_requires = req["install"]
extras_require = {
"cli": req["install"],
"runtime": req["runtime"],
"test": req["test"],
"dev": req["dev"],
}
extras_require["full"] = extras_require["cli"] + extras_require["runtime"] # deprecated
if __name__ == "__main__":
setup(
scripts=["bin/localstack", "bin/localstack.bat"],
packages=find_packages(exclude=("tests", "tests.*")),
package_data=package_data,
install_requires=install_requires,
extras_require=extras_require,
entry_points=load_entry_points(exclude=("tests", "tests.*")),
test_suite="tests",
)