-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
57 lines (52 loc) · 1.54 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
import os
from setuptools import setup, find_packages
here = os.path.dirname(__file__)
with open(os.path.join(here, "LiSE", "pyproject.toml"), "rt") as inf:
for line in inf:
if line.startswith("version"):
_, version, _ = line.split('"')
break
else:
raise ValueError("Couldn't get version")
deps = {}
vers = {}
for subpkg in ["LiSE", "ELiDE"]:
with open(os.path.join(here, subpkg, "pyproject.toml"), "rt") as inf:
for line in inf:
if line.startswith("version"):
_, version, _ = line.split('"')
vers[subpkg] = tuple(map(int, version.split(".")))
if line.startswith("dependencies"):
break
else:
raise ValueError("Couldn't get %s dependencies" % subpkg)
deps[subpkg] = []
for line in inf:
if line == "]\n":
break
_, dep, _ = line.split('"')
if not dep.startswith("LiSE"):
deps[subpkg].append(dep)
else:
raise ValueError("%s dependencies never ended" % subpkg)
datas = []
with open(os.path.join(here, "ELiDE", "MANIFEST.in"), "rt") as inf:
for line in inf:
if line[: len("include")] == "include":
line = line[len("include ") :]
if line[-1] == "\n":
line = line[:-1]
datas.append(os.path.join(here, "ELiDE", line))
setup(
name="LiSE_with_ELiDE",
version=".".join(map(str, max((vers["LiSE"], vers["ELiDE"])))) + "dev",
packages=find_packages(os.path.join(here, "LiSE"))
+ find_packages(os.path.join(here, "ELiDE")),
package_dir={
"LiSE": "LiSE/LiSE",
"ELiDE": "ELiDE/ELiDE",
},
install_requires=deps["LiSE"] + deps["ELiDE"],
package_data={"ELiDE": datas},
include_package_data=True,
)