Skip to content

Commit 1a52b38

Browse files
authored
Merge pull request #104 from imcf/issues/86
Derive version info from git tags
2 parents 28dfa29 + 3287eb9 commit 1a52b38

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

bioformats/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from __future__ import absolute_import, unicode_literals
1313

1414
try:
15-
from _version import __version__
15+
from ._version import version as __version__
1616
except ImportError:
1717
# We're running in a tree that doesn't have a _version.py, so we don't know what our version is.
1818
__version__ = "0.0.0"

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_version():
5454
try:
5555
import re
5656
# From http://stackoverflow.com/a/3619714/17498
57-
cached_version = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
57+
cached_version = re.search(r"^version = ['\"]([^'\"]*)['\"]",
5858
cached_version_line, re.M).group(1)
5959
except:
6060
raise RuntimeError("Unable to find version in %s" % version_file)

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@
3939
"bioformats"
4040
],
4141
url="http://github.com/CellProfiler/python-bioformats/",
42-
version="1.4.0"
42+
setup_requires = ['setuptools_scm'],
43+
use_scm_version = {
44+
"write_to": "bioformats/_version.py",
45+
},
4346
)

0 commit comments

Comments
 (0)