From 96cbb9dad37adbeaadcb064a15279da204f37db7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 7 Mar 2023 10:53:18 -0500 Subject: [PATCH] Patch out max. Python version check entirely --- ...tch-out-maximum-Python-version-check.patch | 27 +++++++++++++++++++ python-llvmlite.spec | 17 +++++++++--- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 0001-Patch-out-maximum-Python-version-check.patch diff --git a/0001-Patch-out-maximum-Python-version-check.patch b/0001-Patch-out-maximum-Python-version-check.patch new file mode 100644 index 0000000..bd5f1fe --- /dev/null +++ b/0001-Patch-out-maximum-Python-version-check.patch @@ -0,0 +1,27 @@ +From 6e526cacbd163f10db5cda62e10744f31d2cb5ad Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Tue, 7 Mar 2023 10:47:38 -0500 +Subject: [PATCH] Patch out maximum Python version check + +Fedora must build this package with the current version of Python, +whether upstream is ready or not. +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 02b1604..b08653d 100644 +--- a/setup.py ++++ b/setup.py +@@ -46,7 +46,7 @@ def _guard_py_ver(): + max_py = parse(max_python_version) + cur_py = parse('.'.join(map(str, sys.version_info[:3]))) + +- if not min_py <= cur_py < max_py: ++ if not min_py <= cur_py: + msg = ('Cannot install on Python version {}; only versions >={},<{} ' + 'are supported.') + raise RuntimeError(msg.format(cur_py, min_py, max_py)) +-- +2.39.2 + diff --git a/python-llvmlite.spec b/python-llvmlite.spec index f58f0ad..b751419 100644 --- a/python-llvmlite.spec +++ b/python-llvmlite.spec @@ -30,6 +30,19 @@ License: BSD-2-Clause AND LicenseRef-Fedora-Public-Domain URL: http://llvmlite.pydata.org/ Source0: %{forgesource} +# Patch out maximum Python version check +# +# Fedora must build this package with the current version of Python, +# whether upstream is ready or not. +# +# Feature request / discussion issue for doing this without a patch: +# “Escape hatch” for maximum Python version check +# https://github.com/numba/llvmlite/issues/912 +# See also: +# python 3.10 support +# https://github.com/numba/llvmlite/issues/740 +Patch: 0001-Patch-out-maximum-Python-version-check.patch + BuildRequires: pyproject-rpm-macros BuildRequires: python3-devel # 0.39.1 only supports llvm11 @@ -85,10 +98,6 @@ Documentation for %{name}. %prep %forgeautosetup -p1 -# seems to be fine with 3.11 and 3.12, but we need to loosen the guard -# see also: “python 3.10 support” https://github.com/numba/llvmlite/issues/740 -sed -i 's/max_python_version =.*/max_python_version = "3.13"/' setup.py - # increase verbosity of tests to 2 sed -i 's/\(def run_tests.*verbosity=\)1/\12/' llvmlite/tests/__init__.py