aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 8b9a070..6e32599 100644
--- a/setup.py
+++ b/setup.py
@@ -324,13 +324,18 @@ def check_requirements():
if __name__ == "__main__":
check_requirements()
- version = re.search(
- '__version__ = "([^\']+)"', open("gensvm/__version__.py").read()
- ).group(1)
+ here = os.path.abspath(os.path.dirname(__file__))
+ about = {}
+ if not VERSION:
+ project_slug = NAME.lower().replace("-", "_").replace(" ", "_")
+ with open(os.path.join(here, project_slug, "__version__.py")) as fp:
+ exec(fp.read(), about)
+ else:
+ about["__version__"] = VERSION
attr = configuration().todict()
- attr["version"] = version
+ attr["version"] = about["__version__"]
attr["description"] = DESCRIPTION
attr["long_description"] = read("README.md")
attr["long_description"] = "text/markdown"