diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-03-06 18:30:27 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-03-06 18:30:27 +0000 |
| commit | 7751bb56706357d73ddeaf5917cab26add23e301 (patch) | |
| tree | b7e156147b82c84398f7d6638deb74efaf5cc5b1 | |
| parent | Bump version (diff) | |
| download | pygensvm-7751bb56706357d73ddeaf5917cab26add23e301.tar.gz pygensvm-7751bb56706357d73ddeaf5917cab26add23e301.zip | |
Properly extract version
| -rw-r--r-- | setup.py | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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" |
