From 1c78ef2507e7288e605063f8ef06199190e966e4 Mon Sep 17 00:00:00 2001 From: Benjamin Beasley Date: Dec 11 2020 15:41:06 +0000 Subject: Fix Python 3.10 incompatibility due to incorrect string-based version detection (RHBZ#1906811, https://github.com/abseil/abseil-py/issues/161) --- diff --git a/python-absl-py-0.11.0-python-3.10.patch b/python-absl-py-0.11.0-python-3.10.patch new file mode 100644 index 0000000..14bde92 --- /dev/null +++ b/python-absl-py-0.11.0-python-3.10.patch @@ -0,0 +1,18 @@ +Fix incorrect string-based version detection, which considered Python 3.10 as +“less than” Python 3.4. See RHBZ#1906811 upstream bug +https://github.com/abseil/abseil-py/issues/161. + +diff -Naur abseil-py-pypi-v0.11.0-original/setup.py abseil-py-pypi-v0.11.0/setup.py +--- abseil-py-pypi-v0.11.0-original/setup.py 2020-10-27 16:02:42.000000000 -0400 ++++ abseil-py-pypi-v0.11.0/setup.py 2020-12-11 10:33:46.954623328 -0500 +@@ -29,8 +29,8 @@ + use_setuptools() + import setuptools + +-py_version = platform.python_version_tuple() +-if py_version < ('2', '7') or py_version[0] == '3' and py_version < ('3', '4'): ++py_version = sys.version_info ++if py_version < (2, 7) or py_version[0] == 3 and py_version < (3, 4): + raise RuntimeError('Python version 2.7 or 3.4+ is required.') + + INSTALL_REQUIRES = [ diff --git a/python-absl-py.spec b/python-absl-py.spec index f8efc95..71f3600 100644 --- a/python-absl-py.spec +++ b/python-absl-py.spec @@ -5,7 +5,7 @@ Name: python-%{srcname} Version: 0.11.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Abseil Python Common Libraries # Overall license is ASL 2.0. Contents of absl/third_party/unittest3_backport/ @@ -14,6 +14,11 @@ License: ASL 2.0 and Python URL: https://github.com/abseil/%{reponame}/ Source0: %{url}/archive/pypi-v%{version}/%{reponame}-pypi-v%{version}.tar.gz +# Fix incorrect string-based version detection, which considered Python 3.10 as +# “less than” Python 3.4. See RHBZ#1906811 and upstream bug +# https://github.com/abseil/abseil-py/issues/161. +Patch0: python-absl-py-0.11.0-python-3.10.patch + BuildRequires: python3-devel >= 3.4 BuildRequires: python3dist(setuptools) BuildRequires: pyproject-rpm-macros @@ -46,7 +51,7 @@ Summary: %{summary} %prep -%autosetup -n %{reponame}-pypi-v%{version} +%autosetup -n %{reponame}-pypi-v%{version} -p1 cp -p absl/third_party/unittest3_backport/LICENSE LICENSE-PYTHON # Despite the third_party/ prefix, absl/third_party/unittest3_backport/ is not @@ -95,6 +100,10 @@ PYTHONPATH=%{buildroot}/%{python3_sitelib}; export PYTHONPATH %changelog +* Fri Dec 11 2020 Benjamin A. Beasley - 1.1.0-4 +- Fix Python 3.10 incompatibility due to incorrect string-based version + detection (RHBZ#1906811, https://github.com/abseil/abseil-py/issues/161) + * Tue Dec 1 2020 Benjamin A. Beasley - 1.1.0-3 - Remove conditionals for Fedora 32 and older