commit 07a585ef1812c1faf7c2eceb78f9825bd0b48b8d Author: Dmitry Samoylik Date: Sun Dec 29 12:28:00 2024 +0300 import python-wrapt-1.16.0-6.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87253c3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/wrapt-1.16.0.tar.gz diff --git a/.python-wrapt.metadata b/.python-wrapt.metadata new file mode 100644 index 0000000..37a5f37 --- /dev/null +++ b/.python-wrapt.metadata @@ -0,0 +1 @@ +85dfb4ef91112e88e256728eaff0aa86172288a0 SOURCES/wrapt-1.16.0.tar.gz diff --git a/SOURCES/260.patch b/SOURCES/260.patch new file mode 100644 index 0000000..8184825 --- /dev/null +++ b/SOURCES/260.patch @@ -0,0 +1,257 @@ +From 185f1f2692a64f7b908b98a25d890b951a12c3c7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Fri, 8 Mar 2024 00:40:11 +0100 +Subject: [PATCH] Fix classmethod tests with Python 3.13+ + +Fixes https://github.com/GrahamDumpleton/wrapt/issues/259 + +The failures were: + + =================================== FAILURES =================================== + _____________ TestCallingOuterClassMethod.test_class_call_function _____________ + + self = + + def test_class_call_function(self): + # Test calling classmethod. Prior to Python 3.9, the instance + # and class passed to the wrapper will both be None because our + # decorator is surrounded by the classmethod decorator. The + # classmethod decorator doesn't bind the method and treats it + # like a normal function, explicitly passing the class as the + # first argument with the actual arguments following that. This + # was only finally fixed in Python 3.9. For more details see: + # https://bugs.python.org/issue19072 + + _args = (1, 2) + _kwargs = {'one': 1, 'two': 2} + + @wrapt.decorator + def _decorator(wrapped, instance, args, kwargs): + if PYXY < (3, 9): + self.assertEqual(instance, None) + self.assertEqual(args, (Class,)+_args) + else: + self.assertEqual(instance, Class) + self.assertEqual(args, _args) + + self.assertEqual(kwargs, _kwargs) + self.assertEqual(wrapped.__module__, _function.__module__) + self.assertEqual(wrapped.__name__, _function.__name__) + + return wrapped(*args, **kwargs) + + @_decorator + def _function(*args, **kwargs): + return args, kwargs + + class Class(object): + @classmethod + @_decorator + def _function(cls, *args, **kwargs): + return (args, kwargs) + + > result = Class._function(*_args, **_kwargs) + + tests/test_outer_classmethod.py:160: + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + tests/test_outer_classmethod.py:141: in _decorator + self.assertEqual(instance, Class) + E AssertionError: None != + ___________ TestCallingOuterClassMethod.test_instance_call_function ____________ + + self = + + def test_instance_call_function(self): + # Test calling classmethod via class instance. Prior to Python + # 3.9, the instance and class passed to the wrapper will both be + # None because our decorator is surrounded by the classmethod + # decorator. The classmethod decorator doesn't bind the method + # and treats it like a normal function, explicitly passing the + # class as the first argument with the actual arguments + # following that. This was only finally fixed in Python 3.9. For + # more details see: https://bugs.python.org/issue19072 + + _args = (1, 2) + _kwargs = {'one': 1, 'two': 2} + + @wrapt.decorator + def _decorator(wrapped, instance, args, kwargs): + if PYXY < (3, 9): + self.assertEqual(instance, None) + self.assertEqual(args, (Class,)+_args) + else: + self.assertEqual(instance, Class) + self.assertEqual(args, _args) + + self.assertEqual(kwargs, _kwargs) + self.assertEqual(wrapped.__module__, _function.__module__) + self.assertEqual(wrapped.__name__, _function.__name__) + + return wrapped(*args, **kwargs) + + @_decorator + def _function(*args, **kwargs): + return args, kwargs + + class Class(object): + @classmethod + @_decorator + def _function(cls, *args, **kwargs): + return (args, kwargs) + + > result = Class()._function(*_args, **_kwargs) + + tests/test_outer_classmethod.py:202: + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + tests/test_outer_classmethod.py:183: in _decorator + self.assertEqual(instance, Class) + E AssertionError: None != + _____________ TestSynchronized.test_synchronized_outer_classmethod _____________ + + self = + + def test_synchronized_outer_classmethod(self): + # Prior to Python 3.9 this isn't detected as a class method + # call, as the classmethod decorator doesn't bind the wrapped + # function to the class before calling and just calls it direct, + # explicitly passing the class as first argument. For more + # details see: https://bugs.python.org/issue19072 + + if PYXY < (3, 9): + _lock0 = getattr(C4.function2, '_synchronized_lock', None) + else: + _lock0 = getattr(C4, '_synchronized_lock', None) + self.assertEqual(_lock0, None) + + c4.function2() + + if PYXY < (3, 9): + _lock1 = getattr(C4.function2, '_synchronized_lock', None) + else: + _lock1 = getattr(C4, '_synchronized_lock', None) + > self.assertNotEqual(_lock1, None) + E AssertionError: None == None + + tests/test_synchronized_lock.py:181: AssertionError + ----------------------------- Captured stdout call ----------------------------- + function2 + =========================== short test summary info ============================ + FAILED tests/test_outer_classmethod.py::TestCallingOuterClassMethod::test_class_call_function + FAILED tests/test_outer_classmethod.py::TestCallingOuterClassMethod::test_instance_call_function + FAILED tests/test_synchronized_lock.py::TestSynchronized::test_synchronized_outer_classmethod + ======================== 3 failed, 435 passed in 0.83s ========================= + +To fix the same failures on Python 3.9, +they were adjusted in the past. For details see +https://github.com/GrahamDumpleton/wrapt/issues/160 + +However, Python 3.13 reverted the change from 3.9, +so this adds an upper bound for the conditionals. + +To make the conditionals easier to read, the if-else branches were switched. +--- + tests/test_outer_classmethod.py | 18 ++++++++++-------- + tests/test_synchronized_lock.py | 26 ++++++++++++++------------ + 2 files changed, 24 insertions(+), 20 deletions(-) + +diff --git a/tests/test_outer_classmethod.py b/tests/test_outer_classmethod.py +index ab807646..c08d34a5 100644 +--- a/tests/test_outer_classmethod.py ++++ b/tests/test_outer_classmethod.py +@@ -128,18 +128,20 @@ def test_class_call_function(self): + # first argument with the actual arguments following that. This + # was only finally fixed in Python 3.9. For more details see: + # https://bugs.python.org/issue19072 ++ # Starting with Python 3.13 the old behavior is back. ++ # For more details see https://github.com/python/cpython/issues/89519 + + _args = (1, 2) + _kwargs = {'one': 1, 'two': 2} + + @wrapt.decorator + def _decorator(wrapped, instance, args, kwargs): +- if PYXY < (3, 9): +- self.assertEqual(instance, None) +- self.assertEqual(args, (Class,)+_args) +- else: ++ if (3, 9) <= PYXY < (3, 13): + self.assertEqual(instance, Class) + self.assertEqual(args, _args) ++ else: ++ self.assertEqual(instance, None) ++ self.assertEqual(args, (Class,)+_args) + + self.assertEqual(kwargs, _kwargs) + self.assertEqual(wrapped.__module__, _function.__module__) +@@ -176,12 +178,12 @@ def test_instance_call_function(self): + + @wrapt.decorator + def _decorator(wrapped, instance, args, kwargs): +- if PYXY < (3, 9): +- self.assertEqual(instance, None) +- self.assertEqual(args, (Class,)+_args) +- else: ++ if (3, 9) <= PYXY < (3, 13): + self.assertEqual(instance, Class) + self.assertEqual(args, _args) ++ else: ++ self.assertEqual(instance, None) ++ self.assertEqual(args, (Class,)+_args) + + self.assertEqual(kwargs, _kwargs) + self.assertEqual(wrapped.__module__, _function.__module__) +diff --git a/tests/test_synchronized_lock.py b/tests/test_synchronized_lock.py +index 0e43f7af..7c41aa5a 100644 +--- a/tests/test_synchronized_lock.py ++++ b/tests/test_synchronized_lock.py +@@ -165,36 +165,38 @@ def test_synchronized_outer_classmethod(self): + # function to the class before calling and just calls it direct, + # explicitly passing the class as first argument. For more + # details see: https://bugs.python.org/issue19072 ++ # Starting with Python 3.13 the old behavior is back. ++ # For more details see https://github.com/python/cpython/issues/89519 + +- if PYXY < (3, 9): +- _lock0 = getattr(C4.function2, '_synchronized_lock', None) +- else: ++ if (3, 9) <= PYXY < (3, 13): + _lock0 = getattr(C4, '_synchronized_lock', None) ++ else: ++ _lock0 = getattr(C4.function2, '_synchronized_lock', None) + self.assertEqual(_lock0, None) + + c4.function2() + +- if PYXY < (3, 9): +- _lock1 = getattr(C4.function2, '_synchronized_lock', None) +- else: ++ if (3, 9) <= PYXY < (3, 13): + _lock1 = getattr(C4, '_synchronized_lock', None) ++ else: ++ _lock1 = getattr(C4.function2, '_synchronized_lock', None) + self.assertNotEqual(_lock1, None) + + C4.function2() + +- if PYXY < (3, 9): +- _lock2 = getattr(C4.function2, '_synchronized_lock', None) +- else: ++ if (3, 9) <= PYXY < (3, 13): + _lock2 = getattr(C4, '_synchronized_lock', None) ++ else: ++ _lock2 = getattr(C4.function2, '_synchronized_lock', None) + self.assertNotEqual(_lock2, None) + self.assertEqual(_lock2, _lock1) + + C4.function2() + +- if PYXY < (3, 9): +- _lock3 = getattr(C4.function2, '_synchronized_lock', None) +- else: ++ if (3, 9) <= PYXY < (3, 13): + _lock3 = getattr(C4, '_synchronized_lock', None) ++ else: ++ _lock3 = getattr(C4.function2, '_synchronized_lock', None) + self.assertNotEqual(_lock3, None) + self.assertEqual(_lock3, _lock2) + diff --git a/SPECS/python-wrapt.spec b/SPECS/python-wrapt.spec new file mode 100644 index 0000000..4e772cb --- /dev/null +++ b/SPECS/python-wrapt.spec @@ -0,0 +1,323 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.6.5) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 6; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +# Sphinx-generated HTML documentation is not suitable for packaging; see +# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. +# +# We can generate PDF documentation as a substitute. +%bcond docs 1 + +Name: python-wrapt +Version: 1.16.0 +Release: %autorelease +Summary: A Python module for decorators, wrappers and monkey patching + +License: BSD-2-Clause +URL: https://github.com/GrahamDumpleton/wrapt +Source: %{url}/archive/%{version}/wrapt-%{version}.tar.gz + +# Fix classmethod tests with Python 3.13+ +Patch: https://github.com/GrahamDumpleton/wrapt/pull/260.patch + +BuildRequires: gcc + +BuildRequires: python3-devel + +# We bypass tox and instead BR and use pytest directly; this is simpler and +# avoids the need to patch out coverage analysis +# (https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters). +BuildRequires: %{py3_dist pytest} + +%global _description %{expand: +The aim of the wrapt module is to provide a transparent object proxy for +Python, which can be used as the basis for the construction of function +wrappers and decorator functions.} + +%description %_description + +%package -n python3-wrapt +Summary: %{summary} + +%description -n python3-wrapt %_description + +%if %{with docs} +%package doc +Summary: Documentation for the wrapt module + +BuildArch: noarch + +BuildRequires: make +BuildRequires: python3-sphinx-latex +BuildRequires: latexmk +# docs/requirements.txt +BuildRequires: %{py3_dist sphinx} +BuildRequires: %{py3_dist sphinx_rtd_theme} + +%description doc +%{summary}. +%endif + +%prep +%autosetup -p1 -n wrapt-%{version} + +%generate_buildrequires +%pyproject_buildrequires + +%build +%pyproject_wheel + +%if %{with docs} +PYTHONPATH="${PWD}" %make_build -C docs latex \ + SPHINXOPTS='-j%{?_smp_build_ncpus}' +%make_build -C docs/_build/latex LATEXMKOPTS='-quiet' +%endif + +%install +%pyproject_install +%pyproject_save_files -l wrapt + +%check +%pytest -v + +%if %{with docs} +%files doc +%license LICENSE +%doc docs/_build/latex/wrapt.pdf +%endif + +%files -n python3-wrapt -f %{pyproject_files} +%doc README.rst + +%changelog +* Sun Dec 29 2024 Dmitriy Samoylik - 1.16.0-6 +- Rebuilt for MSVSphere 10 + +## START: Generated by rpmautospec +* Fri Jul 19 2024 Fedora Release Engineering - 1.16.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jun 07 2024 Python Maint - 1.16.0-5 +- Rebuilt for Python 3.13 + +* Thu Mar 07 2024 Miro Hrončok - 1.16.0-4 +- Fix classmethod tests with Python 3.13+ +- Fixes: rhbz#2256756 + +* Fri Jan 26 2024 Fedora Release Engineering - 1.16.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 1.16.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.16.0-1 +- Update to 1.16.0 (close RHBZ#2160488) + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.15.0-1 +- Update to 1.15.0 (bugfix release) + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-18 +- Port to pyproject-rpm-macros and run the tests + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-17 +- Improve the source URL + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-16 +- Do not number the sole Source + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-15 +- Make the -doc subpackage noarch + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-14 +- Build Sphinx-generated docs as PDF, not HTML, to sidestep guidelines + issues + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-13 +- Write BuildRequires using project canonical names + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-12 +- Reduce description/Summary duplication in the spec file + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-11 +- Add missing LICENSE to -doc subpackage + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-10 +- Use modern build conditionals + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-9 +- Reduce unnecessary macro indirection in the spec file + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-8 +- Remove obsolete %%python_provide macro + +* Fri Dec 29 2023 Benjamin A. Beasley - 1.14.1-7 +- Remove ancient workaround for missing %%license support + +* Wed Aug 02 2023 Jan Friesse - 1.14.1-6 +- migrated to SPDX license + +* Fri Jul 21 2023 Fedora Release Engineering - 1.14.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jun 15 2023 Python Maint - 1.14.1-4 +- Rebuilt for Python 3.12 + +* Wed Mar 01 2023 Miro Hrončok - 1.14.1-3 +- BuildRequire setuptools explicitly, not just transitively + +* Fri Jan 20 2023 Fedora Release Engineering - 1.14.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sun Sep 18 2022 Kevin Fenzi - 1.14.1-1 +- Update to 1.14.1. Fixes rhbz#2081156 + +* Fri Jul 22 2022 Fedora Release Engineering - 1.14.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 1.14.0-2 +- Rebuilt for Python 3.11 + +* Sat Mar 26 2022 Zbigniew Jędrzejewski-Szmek - 1.14.0-1 +- Version 1.14.0 (rhbz#2061075) + +* Fri Jan 21 2022 Fedora Release Engineering - 1.13.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sat Nov 06 2021 Kevin Fenzi - 1.13.3-1 +- Update to 1.13.3. Fixes rhbz#2010551 + +* Tue Oct 26 2021 Joel Capitao - 1.13.2-1 +- Update to 1.13.2 + +* Tue Jul 27 2021 Fedora Release Engineering - 1.12.1-6 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jun 03 2021 Python Maint - 1.12.1-5 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.12.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 1.12.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat May 23 2020 Miro Hrončok - 1.12.1-2 +- Rebuilt for Python 3.9 + +* Tue Mar 17 2020 Clément Verna - 1.12.1-1 +- Update to 1.12.1. Fixes bug #1803787 + +* Thu Jan 30 2020 Fedora Release Engineering - 1.11.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Sep 11 2019 Miro Hrončok - 1.11.2-4 +- Subpackage python2-wrapt has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Fri Aug 16 2019 Miro Hrončok - 1.11.2-3 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 1.11.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Jun 22 2019 Kevin Fenzi - 1.11.2-1 +- Update to 1.11.2. Fixes bug #1667650 + +* Thu Feb 07 2019 Javier Peña - 1.11.1-1 +- Update to upstream 1.11.1 + +* Sat Feb 02 2019 Fedora Release Engineering - 1.10.11-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1.10.11-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jun 15 2018 Miro Hrončok - 1.10.11-4 +- Rebuilt for Python 3.7 + +* Mon Feb 12 2018 Iryna Shcherbina - 1.10.11-3 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Fri Feb 09 2018 Fedora Release Engineering - 1.10.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sun Dec 17 2017 Kevin Fenzi - 1.10.11-1 +- Update to 1.10.11. Fixes bug #1480582 + +* Wed Sep 27 2017 Troy Dawson - 1.10.10-5 +- Cleanup spec file conditionals + +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 1.10.10-4 +- Python 2 binary package renamed to python2-wrapt + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + +* Thu Aug 03 2017 Fedora Release Engineering - 1.10.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.10.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Mar 15 2017 Ralph Bean - 1.10.10-1 +- new version + +* Wed Mar 15 2017 Ralph Bean - 1.10.9-1 +- new version + +* Sat Feb 11 2017 Fedora Release Engineering - 1.10.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Dec 09 2016 Charalampos Stratakis - 1.10.8-3 +- Rebuild for Python 3.6 + +* Tue Jul 19 2016 Fedora Release Engineering - 1.10.8-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Fri Apr 15 2016 Kevin Fenzi - 1.10.8-1 +- Update to 1.10.8. Fixes bug #1325923 + +* Mon Apr 04 2016 Ralph Bean - 1.10.7-1 +- new version + +* Thu Feb 04 2016 Fedora Release Engineering - 1.10.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Nov 10 2015 Fedora Release Engineering - 1.10.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + +* Mon Jul 06 2015 Ralph Bean - 1.10.5-1 +- new version + +* Thu Jun 18 2015 Fedora Release Engineering - 1.10.4-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri May 15 2015 Ralph Bean - 1.10.4-6 +- Don't build docs on epel7 (the rtd theme is problematic). + +* Sat Apr 11 2015 Ralph Bean - 1.10.4-5 +- Add python3 subpackage + +* Wed Mar 25 2015 Chandan Kumar - 1.10.4-4 +- Added doc files for doc subpackage + +* Wed Mar 25 2015 Chandan Kumar - 1.10.4-3 +- Fixed Docs + +* Tue Mar 24 2015 Chandan Kumar - 1.10.4-2 +- Removed cflags and group section fro doc subpackage + +* Tue Mar 24 2015 Chandan Kumar - 1.10.4-1 +- Bumped to upstream version 1.10.4 +- Add docs + +* Wed Mar 11 2015 Chandan Kumar - 1.10.2-1 +- Initial package. + +## END: Generated by rpmautospec