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): """