-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·49 lines (35 loc) · 1.05 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
#!/usr/bin/env python3
""" Setup script """
import importlib
import os
import setuptools
def _setup():
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'CHANGELOG.rst')) as file_:
changelog = file_.read()
version = changelog.splitlines()[4]
# Add the command class for use in this very setup script. Which means the
# project is probably not installed yet. To achieve this the module
# containing the class is dynamically imported.
module_name = 'core'
module_path = os.path.join(
here, 'src', 'zapp',
'{}.py'.format(module_name),
)
module_spec = importlib.util.spec_from_file_location(
module_name,
module_path,
)
module = importlib.util.module_from_spec(module_spec)
module_spec.loader.exec_module(module)
cmdclass = {
'bdist_zapp': getattr(module, 'bdist_zapp'),
}
setuptools.setup(
# see 'setup.cfg'
version=version,
cmdclass=cmdclass,
)
if __name__ == '__main__':
_setup()
# EOF