[h5py] 07/09: Fix version_tuple to make it PEP440 compliant

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 25 14:28:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository h5py.

commit f5a5140861f88fc7086c81ea2d16812ac71a84fa
Author: James Tocknell <aragilar at gmail.com>
Date:   Wed Jan 25 22:27:46 2017 +1100

    Fix version_tuple to make it PEP440 compliant
---
 h5py/version.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/h5py/version.py b/h5py/version.py
index f5c3287..066b921 100644
--- a/h5py/version.py
+++ b/h5py/version.py
@@ -13,22 +13,30 @@
 
 from __future__ import absolute_import
 
+from collections import namedtuple
 from . import h5 as _h5
-from distutils.version import StrictVersion as _sv
 import sys
 import numpy
 
-version = "2.7.0rc3"
+# All should be integers, except pre, as validating versions is more than is
+# needed for our use case
+_H5PY_VERSION_CLS = namedtuple("_H5PY_VERSION_CLS", "major minor bugfix pre post dev")
 
-_exp = _sv(version)
+version_tuple = _H5PY_VERSION_CLS(2, 7, 0, "rc3", None, None)
 
-version_tuple = _exp.version + ((''.join(str(x) for x in _exp.prerelease),) if _exp.prerelease is not None else ('',))
+version = "{0.major:d}.{0.minor:d}.{0.bugfix:d}".format(version_tuple)
+if version_tuple.pre is not None:
+    version += version_tuple.pre
+if version_tuple.post is not None:
+    version += ".post{0.post:d}".format(version_tuple)
+if version_tuple.dev is not None:
+    version += ".dev{0.dev:d}".format(version_tuple)
 
 hdf5_version_tuple = _h5.get_libversion()
 hdf5_version = "%d.%d.%d" % hdf5_version_tuple
 
 api_version_tuple = (1,8)
-api_version = "1.8"
+api_version = "%d.%d" % api_version_tuple
 
 info = """\
 Summary of the h5py configuration

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list