Skip to content

Commit

Permalink
ENH:Single source versioning, version to 0.1.1 (#6)
Browse files Browse the repository at this point in the history
* ENH:Single_source_versioning

* CI:Update version to 0.1.1
  • Loading branch information
ViktorvdValk committed Mar 29, 2021
1 parent 590baa3 commit f4dbf95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion elastix_napari/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__author__ = "Viktor van der Valk"
__email__ = "v.o.van_der_valk@lumc.nl"

__version__ = "0.1.0"
__version__ = "0.1.1"

def get_module_version():
return __version__
Expand Down
20 changes: 16 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@
import codecs
from setuptools import setup, find_packages

def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
# def read(fname):
# file_path = os.path.join(os.path.dirname(__file__), fname)
# return codecs.open(file_path, encoding='utf-8').read()

def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()

def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith('__version__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")

# Add your dependencies in requirements.txt
# Note: you can add test-specific requirements in tox.ini
Expand All @@ -35,7 +47,7 @@ def read(fname):
packages=find_packages(),
python_requires='>=3.6',
install_requires=requirements,
version = "0.1.0",
version=get_version("elastix_napari/__init__.py"),
setup_requires=['setuptools_scm'],
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit f4dbf95

Please sign in to comment.