From d1a02fdda78743c796fe5c01cbb5287a8f3c873b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 10 Jul 2020 15:08:30 +0200 Subject: [PATCH] pythondistdeps.py: Adapt Python version marker workaround for setuptools 42+ See https://bugzilla.redhat.com/show_bug.cgi?id=1853597#c11 pkg_resources from setuptools 42+ no longer only use platform.python_version(), but also platform.python_version_tuple() -- this was updated in packaging 19.1+. This fix makes it work again with both new and old setuptools, hopefully for some while. https://github.com/pypa/setuptools/commit/bf069fe9ddcadaa2c029067601d06a07d037d4f7 https://github.com/pypa/packaging/commit/86a443f3185024edd0b826afdd91d8f9a4917022 --- python-rpm-generators.spec | 1 + pythondistdeps.py | 1 + 2 files changed, 2 insertions(+) diff --git a/python-rpm-generators.spec b/python-rpm-generators.spec index c7d8c46..a4646df 100644 --- a/python-rpm-generators.spec +++ b/python-rpm-generators.spec @@ -50,6 +50,7 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} *.py * Fri Jul 10 2020 Tomas Orsava - 11-9 - pythondistdeps: Implement provides/requires for extras packages - Enable --require-extras-subpackages +- Adapt Python version marker workaround for setuptools 42+ * Fri Jun 26 2020 Miro HronĨok - 11-8 - Fix python(abi) requires generator, it picked files from almost good directories diff --git a/pythondistdeps.py b/pythondistdeps.py index 5563769..39e53bc 100755 --- a/pythondistdeps.py +++ b/pythondistdeps.py @@ -273,6 +273,7 @@ if __name__ == "__main__": # [2] https://github.com/pypa/setuptools/pull/1275 import platform platform.python_version = lambda: dist.py_version + platform.python_version_tuple = lambda: tuple(dist.py_version.split('.')) # This is the PEP 503 normalized name. # It does also convert dots to dashes, unlike dist.key.