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.

bf069fe9dd
86a443f318
This commit is contained in:
Miro Hrončok 2020-07-10 15:08:30 +02:00
parent 32a1b47f5b
commit d1a02fdda7
2 changed files with 2 additions and 0 deletions

View File

@ -50,6 +50,7 @@ install -Dpm0755 -t %{buildroot}%{_rpmconfigdir} *.py
* Fri Jul 10 2020 Tomas Orsava <torsava@redhat.com> - 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 <mhroncok@redhat.com> - 11-8
- Fix python(abi) requires generator, it picked files from almost good directories

View File

@ -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.