From a9a1bd5a0aec3f52f0f09de62fcc18a62b959bdc Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Apr 2017 18:39:45 +0200 Subject: [PATCH] acceptance test and changelog for issue #167 --- CHANGELOG.rst | 6 ++++++ testing/conftest.py | 10 +++++++--- testing/test_basic_api.py | 3 +++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 50f0cdef..054bfe57 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,9 @@ +v1.15.5 +======= + +* fix #167 by correctly respecting preformatted version metadata + from PKG-INFO/EGG-INFO + v1.15.4 ======= diff --git a/testing/conftest.py b/testing/conftest.py index 49a9d14b..29e129c5 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -52,14 +52,18 @@ def commit_testfile(self, reason=None): self(self.add_command) self.commit(reason=reason) - @property - def version(self): + def get_version(self, **kw): __tracebackhide__ = True from setuptools_scm import get_version - version = get_version(root=str(self.cwd)) + version = get_version(root=str(self.cwd), **kw) print(version) return version + @property + def version(self): + __tracebackhide__ = True + return self.get_version() + @pytest.yield_fixture(autouse=True) def debug_mode(): diff --git a/testing/test_basic_api.py b/testing/test_basic_api.py index 5f9e1d60..4192f714 100644 --- a/testing/test_basic_api.py +++ b/testing/test_basic_api.py @@ -30,6 +30,9 @@ def test_version_from_pkginfo(wd): wd.write('PKG-INFO', 'Version: 0.1') assert wd.version == '0.1' + # replicate issue 167 + assert wd.get_version(version_scheme="1.{0.distance}.0".format) == '0.1' + def assert_root(monkeypatch, expected_root): """