-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
56 lines (40 loc) · 1.1 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
""" Setup script for the ci-hooks-app application.
"""
from os import walk
from os.path import join
from setuptools import find_packages
from setuptools import setup
def _listdir(root):
""" Recursively list all files under 'root'.
"""
for path, _, names in walk(root):
yield path, tuple(join(path, name) for name in names)
return
_CONFIG = {
"name": "ci_hooks_app",
"author": "René Fritze",
"author_email": "[email protected]",
"url": "",
"package_dir": {"": "src"},
"packages": find_packages("src"),
"entry_points": {
"console_scripts": ("ci_hooks_app = ci_hooks_app.cli:main",),
},
}
def _version():
""" Get the local package version.
"""
path = join("src", _CONFIG["name"], "__version__.py")
namespace = {}
with open(path) as stream:
exec(stream.read(), namespace)
return namespace["__version__"]
def main():
""" Execute the setup commands.
"""
_CONFIG["version"] = _version()
setup(**_CONFIG)
return 0
# Make the script executable.
if __name__ == "__main__":
raise SystemExit(main())