Skip to content

Commit

Permalink
move version location to code instead of setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Saul committed Sep 10, 2018
1 parent c547353 commit ade904e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 1 addition & 3 deletions ripser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from .ripser import *

# Enable access to version number
import pkg_resources
__version__ = pkg_resources.get_distribution('ripser').version
from ._version import __version__
1 change: 1 addition & 0 deletions ripser/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.3.0"
15 changes: 14 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
sys.exit(1)


import re
VERSIONFILE="persim/_version.py"
verstrline = open(VERSIONFILE, "rt").read()
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
mo = re.search(VSRE, verstrline, re.M)
if mo:
verstr = mo.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))




with open('README.md') as f:
long_description = f.read()

Expand All @@ -37,7 +50,7 @@ def run(self):


setup(name="ripser",
version='0.3.0',
version=verstr,
description="A Lean Persistent Homology Library for Python",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit ade904e

Please sign in to comment.