diff --git a/doc/conf.py b/doc/conf.py index 4932aca9..1fe33f92 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -21,11 +21,6 @@ sys.path.insert(0, os.path.abspath('../scadnano')) # print(sys.path) -# from scadnano.scadnano_version import current_version -# this is ugly, but appears to be standard practice: -# https://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package/17626524#17626524 -# __version__ = open("../scadnano/_version.py").readlines()[-1].split()[-1].strip("\"'") - # this is ugly, but appears to be standard practice: # https://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package/17626524#17626524 def extract_version(filename: str): diff --git a/scadnano/_version.py b/scadnano/_version.py deleted file mode 100644 index 3f2ecc12..00000000 --- a/scadnano/_version.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Version information.""" -# taken from https://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package/17626524#17626524 - -# The following line *must* be the last in the module, exactly as formatted: -# XXX: REMEMBER TO CHANGE VERSION IN scadnano.py also, for users who do not install from PyPI -__version__ = "0.10.2" diff --git a/setup.py b/setup.py index 694927ad..cf66d55c 100644 --- a/setup.py +++ b/setup.py @@ -10,12 +10,9 @@ from setuptools import setup + # import scadnano.scadnano_version as sv -# from scadnano.scadnano_version import current_version -# this is ugly, but appears to be standard practice: -# https://stackoverflow.com/questions/17583443/what-is-the-correct-way-to-share-package-version-with-setup-py-and-the-package/17626524#17626524 -# __version__ = open("scadnano/_version.py").readlines()[-1].split()[-1].strip("\"'") def extract_version(filename: str): with open(filename) as f: @@ -31,6 +28,7 @@ def extract_version(filename: str): return version_str raise AssertionError(f'could not find version in {filename}') + __version__ = extract_version('scadnano/scadnano.py') # read the contents of your README file