forked from chaostoolkit/chaostoolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
26 lines (21 loc) · 721 Bytes
/
setup.py
File metadata and controls
26 lines (21 loc) · 721 Bytes
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
#!/usr/bin/env python
"""chaostoolkit builder and installer"""
import os.path
from setuptools import setup
def get_version_from_package() -> str:
"""
Read the package version from the source without importing it.
"""
path = os.path.join(os.path.dirname(__file__), "chaostoolkit/__init__.py")
path = os.path.normpath(os.path.abspath(path))
with open(path) as f:
for line in f:
if line.startswith("__version__"):
token, version = line.split(" = ", 1)
version = version.replace("\"", "").strip()
return version
if __name__ == '__main__':
setup(
name="chaostoolkit",
version=get_version_from_package()
)