diff --git a/4100.patch b/4100.patch new file mode 100644 index 0000000..dfc8227 --- /dev/null +++ b/4100.patch @@ -0,0 +1,33 @@ +From a241746b2a496540bb6cbe64a5b59eb5bb1c50a6 Mon Sep 17 00:00:00 2001 +From: Miro HronĨok +Date: May 28 2024 20:10:07 +0000 +Subject: setup.py: Fix version retrieval on Python 3.13+ + + +Accessing __version__ from locals() no longer works. + +This was reported to Python in https://github.com/python/cpython/issues/118888 +but according to Python developers, it: + + - is an intended change of behavior described in PEP 667 + - was an illegal usage that happens to work in a favored way to begin with + +--- + +diff --git a/setup.py b/setup.py +index 91f7d76..4d38c08 100755 +--- a/setup.py ++++ b/setup.py +@@ -25,8 +25,9 @@ def get_install_requires(): + + def get_version(): + cwd = os.path.dirname(__file__) +- exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read()) +- return locals()['__version__'] ++ lcls = {} ++ exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read(), None, lcls) ++ return lcls['__version__'] + + + def get_long_description(): + diff --git a/koji.spec b/koji.spec index 6b0306c..c0acfd6 100644 --- a/koji.spec +++ b/koji.spec @@ -33,6 +33,8 @@ Patch104: https://pagure.io/koji/c/0251961929a45ccae1d635b7e85a9d8826baf72d.patc Patch105: https://pagure.io/koji/c/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch # Add index for rpminfo Patch106: https://pagure.io/koji/pull-request/4026.patch +# setup.py: Fix version retrieval on Python 3.13+ +Patch107: https://pagure.io/koji/pull-request/4100.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release}