-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·70 lines (58 loc) · 2.42 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author : Hu Ji
@file : setup.py
@time : 2018/11/25
@site :
@software: PyCharm
,----------------, ,---------,
,-----------------------, ," ,"|
," ,"| ," ," |
+-----------------------+ | ," ," |
| .-----------------. | | +---------+ |
| | | | | | -==----'| |
| | $ sudo rm -rf / | | | | | |
| | | | |/----|`---= | |
| | | | | ,/|==== ooo | ;
| | | | | // |(((( [33]| ,"
| `-----------------' |," .;'| |(((( | ,"
+-----------------------+ ;; | | |,"
/_)______________(_/ //' | +---------+
___________________________/___ `,
/ oooooooooooooooo .o. oooo /, `,"-----------
/ ==ooooooooooooooo==.o. ooo= // ,``--{)B ,"
/_==__==========__==_ooo__ooo=_/' /___________,"
"""
import os
import yaml
from setuptools import setup
def get_root_path(*paths):
return os.path.join(os.path.abspath(os.path.dirname(__file__)), *paths)
def get_src_path(*paths):
return get_root_path("src", "linktools-cntr", *paths)
if __name__ == '__main__':
release = os.environ.get("RELEASE", "false").lower() == "true"
version = os.environ.get("VERSION", "0.0.1.dev0")
if version.startswith("v"):
version = version[len("v"):]
with open(get_root_path("requirements.yml"), "rt", encoding="utf-8") as fd:
data = yaml.safe_load(fd)
# install_requires = dependencies + dev-dependencies
install_requires = data.get("dependencies")
install_requires.extend(data.get("release-dependencies") if release else data.get("dev-dependencies"))
# extras_require = optional-dependencies
extras_require = data.get("optional-dependencies")
all_requires = []
for requires in extras_require.values():
all_requires.extend(requires)
extras_require["all"] = all_requires
setup(
version=version,
install_requires=install_requires,
extras_require=extras_require,
entry_points={
"console_scripts": ["ct-cntr = linktools_cntr.__main__:command.main"],
"linktools_scripts": ["ct-cntr = linktools_cntr.__main__:command.main"],
},
)