forked from uyuni-project/uyuni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
35 lines (31 loc) · 810 Bytes
/
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
# coding: utf-8
"""
Setup file.
"""
import os
from setuptools import setup, find_packages
def get_version_changelog():
"""
Get a version from the current changelog.
"""
changelog = None
version = "4.2.1"
for fname in os.listdir(os.path.dirname(os.path.abspath(__file__))):
if fname.endswith(".changes"):
changelog = fname
break
if changelog:
with open(changelog, "r") as hcl:
for line in hcl.readlines():
if "version" in line:
version = line.split(" ")[-1] # Typically version is the last one
break
return version
setup(
name='spacecmd',
version=get_version_changelog(),
packages=find_packages(where="src"),
package_dir={
"": "src",
}
)