From 24a4468b88e0c34db5ff13717bd416d77c15855b1708165d59f6818f7912d814 Mon Sep 17 00:00:00 2001 From: Nico Krapp Date: Fri, 28 Feb 2025 14:24:50 +0000 Subject: [PATCH] =?UTF-8?q?-=20Update=20to=201.17.2=20=20=20*=20Added=20un?= =?UTF-8?q?iversal=20binary=20wheels=20for=20macOS.=20That=20is,=20contain?= =?UTF-8?q?s=20=20=20=20=20both=20x86=5F64=20and=20arm64=20architectures?= =?UTF-8?q?=20in=20the=20same=20wheel.=20-=20from=20version=201.17.1=20=20?= =?UTF-8?q?=20*=20Due=20to=20GitHub=20actions=20changes,=20binary=20wheels?= =?UTF-8?q?=20were=20missing=20=20=20=20=20for=20macOS=20Intel.=20=20=20*?= =?UTF-8?q?=20Not=20implemented=20error=20for=20=5F=5Freduce=5F=5F()=20on?= =?UTF-8?q?=20ObjectProxy=20was=20=20=20=20=20incorrectly=20displaying=20t?= =?UTF-8?q?he=20error=20as=20being=20on=20=5F=5Freduce=5Fex=5F=5F().=20-?= =?UTF-8?q?=20from=20version=201.17.0=20=20=20*=20Add=20=5F=5Fformat=5F=5F?= =?UTF-8?q?()=20method=20to=20ObjectProxy=20class=20to=20allow=20formattin?= =?UTF-8?q?g=20=20=20=20=20of=20wrapped=20object.=20=20=20*=20Added=20C=20?= =?UTF-8?q?extension=20internal=20flag=20to=20indicate=20that=20wrapt=20sh?= =?UTF-8?q?ould=20be=20=20=20=20=20safe=20for=20Python=203.13=20free=20thr?= =?UTF-8?q?eading=20mode.=20Releases=20will=20include=20=20=20=20=20free?= =?UTF-8?q?=20threading=20variants=20of=20Python=20wheels.=20Note=20that?= =?UTF-8?q?=20as=20free=20=20=20=20=20threading=20is=20new,=20one=20should?= =?UTF-8?q?=20be=20cautious=20about=20using=20it=20in=20=20=20=20=20produc?= =?UTF-8?q?tion=20until=20it=20has=20been=20more=20widely=20tested.=20=20?= =?UTF-8?q?=20*=20When=20a=20normal=20function=20or=20builtin=20function?= =?UTF-8?q?=20which=20had=20wrapt.decorator=20=20=20=20=20or=20a=20functio?= =?UTF-8?q?n=20wrapper=20applied,=20was=20assigned=20as=20a=20class=20attr?= =?UTF-8?q?ibute,=20=20=20=20=20and=20the=20function=20attribute=20called?= =?UTF-8?q?=20via=20the=20class=20or=20an=20instance=20of=20=20=20=20=20th?= =?UTF-8?q?e=20class,=20an=20additional=20argument=20was=20being=20passed,?= =?UTF-8?q?=20inserted=20as=20the=20=20=20=20=20first=20argument,=20which?= =?UTF-8?q?=20was=20the=20class=20or=20instance.=20This=20was=20not=20the?= =?UTF-8?q?=20=20=20=20=20correct=20behaviour=20and=20the=20class=20or=20i?= =?UTF-8?q?nstance=20should=20not=20have=20been=20=20=20=20=20passed=20as?= =?UTF-8?q?=20the=20first=20argument.=20=20=20*=20When=20an=20instance=20o?= =?UTF-8?q?f=20a=20callable=20class=20object=20was=20wrapped=20which=20did?= =?UTF-8?q?n=E2=80=99t=20=20=20=20=20not=20have=20a=20=5F=5Fget=5F=5F()=20?= =?UTF-8?q?method=20for=20binding,=20and=20it=20was=20called=20in=20contex?= =?UTF-8?q?t=20=20=20=20=20where=20binding=20would=20be=20attempted,=20it?= =?UTF-8?q?=20would=20fail=20with=20error=20that=20=5F=5Fget=5F=5F()=20=20?= =?UTF-8?q?=20=20=20did=20not=20exist=20when=20instead=20it=20should=20hav?= =?UTF-8?q?e=20been=20called=20directly,=20ignoring=20=20=20=20=20that=20b?= =?UTF-8?q?inding=20was=20not=20possible.=20=20=20*=20The=20=5F=5Fround=5F?= =?UTF-8?q?=5F=20hook=20for=20the=20object=20proxy=20didn=E2=80=99t=20acce?= =?UTF-8?q?pt=20ndigits=20argument.=20-=20Drop=20py313-classmethods.patch,?= =?UTF-8?q?=20merged=20upstream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wrapt?expand=0&rev=39 --- .gitattributes | 23 ++++ .gitignore | 1 + 1.16.0.tar.gz | 3 + 1.17.2.tar.gz | 3 + py313-classmethods.patch | 262 ++++++++++++++++++++++++++++++++++++++ python-wrapt.changes | 264 +++++++++++++++++++++++++++++++++++++++ python-wrapt.spec | 80 ++++++++++++ 7 files changed, 636 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 1.16.0.tar.gz create mode 100644 1.17.2.tar.gz create mode 100644 py313-classmethods.patch create mode 100644 python-wrapt.changes create mode 100644 python-wrapt.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/1.16.0.tar.gz b/1.16.0.tar.gz new file mode 100644 index 0000000..d0bbf80 --- /dev/null +++ b/1.16.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:107dc12b9d60100b7219169dad7687986407dc7bade3ef965b20fe82e1c3a6dc +size 138520 diff --git a/1.17.2.tar.gz b/1.17.2.tar.gz new file mode 100644 index 0000000..8f261ff --- /dev/null +++ b/1.17.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:913d738fdea56516a0b8f9a9c365485c32af3cac7fe8577b2b1fb99f7d377953 +size 140660 diff --git a/py313-classmethods.patch b/py313-classmethods.patch new file mode 100644 index 0000000..741db65 --- /dev/null +++ b/py313-classmethods.patch @@ -0,0 +1,262 @@ +From 9a38c9f45a2e9d2a306deedce2e243b5e7a83ab2 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+ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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. + +Signed-off-by: Filipe Laíns +--- + 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/python-wrapt.changes b/python-wrapt.changes new file mode 100644 index 0000000..9b12733 --- /dev/null +++ b/python-wrapt.changes @@ -0,0 +1,264 @@ +------------------------------------------------------------------- +Fri Feb 28 08:57:55 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 1.17.2 + * Added universal binary wheels for macOS. That is, contains + both x86_64 and arm64 architectures in the same wheel. +- from version 1.17.1 + * Due to GitHub actions changes, binary wheels were missing + for macOS Intel. + * Not implemented error for __reduce__() on ObjectProxy was + incorrectly displaying the error as being on __reduce_ex__(). +- from version 1.17.0 + * Add __format__() method to ObjectProxy class to allow formatting + of wrapped object. + * Added C extension internal flag to indicate that wrapt should be + safe for Python 3.13 free threading mode. Releases will include + free threading variants of Python wheels. Note that as free + threading is new, one should be cautious about using it in + production until it has been more widely tested. + * When a normal function or builtin function which had wrapt.decorator + or a function wrapper applied, was assigned as a class attribute, + and the function attribute called via the class or an instance of + the class, an additional argument was being passed, inserted as the + first argument, which was the class or instance. This was not the + correct behaviour and the class or instance should not have been + passed as the first argument. + * When an instance of a callable class object was wrapped which didn’t + not have a __get__() method for binding, and it was called in context + where binding would be attempted, it would fail with error that __get__() + did not exist when instead it should have been called directly, ignoring + that binding was not possible. + * The __round__ hook for the object proxy didn’t accept ndigits argument. +- Drop py313-classmethods.patch, merged upstream + +------------------------------------------------------------------- +Mon Oct 28 11:56:13 UTC 2024 - Dirk Müller + +- add py313-classmethods.patch to fix test failures with py313 + +------------------------------------------------------------------- +Mon Nov 27 20:31:38 UTC 2023 - Dirk Müller + +- update to 1.16.0: + * Note that version 1.16.0 drops support for Python 2.7 and + 3.5. Python version 3.6 or later is required. + * The ``patch_function_wrapper()`` decorator now accepts an + ``enabled`` argument, which can be a literal boolean value, + object that evaluates as boolean, or a callable object which + returns a boolean. In the case of a callable, determination + of whether the wrapper is invoked will be left until + the point of the call. In the other cases, the wrapper will + not be applied if the value evaluates false at the point of + applying the wrapper. + * The import hook loader and finder objects are now implemented + as transparent object proxies so they properly proxy pass + access to attributes/functions of the wrapped loader or finder. + * Code files in the implementation have been reorganized such + that the pure Python version of the ``ObjectProxy`` class + is directly available even if the C extension variant is + being used. This is to allow the pure Python variant to + be used in exceptional cases where the C extension variant is + not fully compatible with the pure Python implementation and the + behaviour of the pure Python variant is what is required. + * It was not possible to update the ``__class__`` attribute + through the transparent object proxy when relying on the C + implementation. + +------------------------------------------------------------------- +Thu May 4 20:43:27 UTC 2023 - Dirk Müller + +- update to 1.15.0: + * When the C extension for wrapt was being used, and a property + was used on an object proxy wrapping another object to intercept + access to an attribute of the same name on the wrapped object, + if the function implementing the property + raised an exception, then the exception was ignored and not + propagated back to the caller. + * Address issue where the post import hook mechanism of wrapt + wasn't transparent and left the __loader__ and __spec__.loader + attributes of a module as the wrapt import hook loader and + not the original loader. + * Address issues where a thread deadlock could occur within the + wrapt module import handler, when code executed from a post + import hook created a new thread and code executed in the + context of the new thread itself tried to register a post + import hook, or imported a new module. + * When using ``CallableObjectProxy`` as a wrapper for a type or + function and calling the wrapped object, it was not possible + to pass a keyword argument named ``self``. + +------------------------------------------------------------------- +Fri Apr 21 12:38:55 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:45:59 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Sat Oct 1 14:04:50 UTC 2022 - Dirk Müller + +- update to 1.14.1: + * When the post import hooks mechanism was being used, and a Python package with + its own custom module importer was used, importing modules could fail if the + custom module importer didn't use the latest Python import hook finder/loader + APIs and instead used the deprecated API. This was actually occurring with the + `zipimporter` in Python itself, which was not updated to use the newer Python + APIs until Python 3.10. + **Bugs Fixed** + * Python 3.11 dropped ``inspect.formatargspec()`` which was used in creating + signature changing decorators. Now bundling a version of this function + which uses ``Parameter`` and ``Signature`` from ``inspect`` module when + available. The replacement function is exposed as ``wrapt.formatargspec()`` + if need it for your own code. + * When using a decorator on a class, ``isinstance()`` checks wouldn't previously + work as expected and you had to manually use ``Type.__wrapped__`` to access + the real type when doing instance checks. The ``__instancecheck__`` hook is + now implemented such that you don't have to use ``Type.__wrapped__`` instead + of ``Type`` as last argument to ``isinstance()``. + * Eliminated deprecation warnings related to Python module import system, which + would have turned into broken code in Python 3.12. This was used by the post + import hook mechanism. + +------------------------------------------------------------------- +Sat Nov 6 18:18:03 UTC 2021 - Dirk Müller + +- update to 1.13.3: + * Adds wheels for Python 3.10 on PyPi and where possible also now + generating binary wheels for ``musllinux``. + +------------------------------------------------------------------- +Tue Oct 26 21:13:04 UTC 2021 - Dirk Müller + +- update to 1.13.2: + * Note that the next signficant release of `wrapt` will drop support for + Python 2.7 and Python 3.5. + * Fix Python version constraint so PyPi classifier for ``pip`` requires + Python 2.7 or Python 3.5+. + * When a reference to a class method was taken out of a class, and then + wrapped in a function wrapper, and called, the class type was not being + passed as the instance argument, but as the first argument in args, + with the instance being ``None``. The class type should have been passed + as the instance argument. + * If supplying an adapter function for a signature changing decorator + using input in the form of a function argument specification, name lookup + exceptions would occur where the adaptor function had annotations which + referenced non builtin Python types. Although the issues have been + addressed where using input data in the format usually returned by + ``inspect.getfullargspec()`` to pass the function argument specification, + you can still have problems when supplying a function signature as + string. In the latter case only Python builtin types can be referenced + in annotations. + * When a decorator was applied on top of a data/non-data descriptor in a + class definition, the call to the special method ``__set_name__()`` to + notify the descriptor of the variable name was not being propogated. Note + that this issue has been addressed in the ``FunctionWrapper`` used by + ``@wrapt.decorator`` but has not been applied to the generic + ``ObjectProxy`` class. If using ``ObjectProxy`` directly to construct a + custom wrapper which is applied to a descriptor, you will need to + propogate the ``__set_name__()`` call yourself if required. + * The ``issubclass()`` builtin method would give incorrect results when used + with a class which had a decorator applied to it. Note that this has only + been able to be fixed for Python 3.7+. Also, due to what is arguably a + bug (https://bugs.python.org/issue44847) in the Python standard library, + you will still have problems when the class heirarchy uses a base class + which has the ``abc.ABCMeta`` metaclass. In this later case an exception + will be raised of ``TypeError: issubclass() arg 1 must be a class``. +- drop fix-dummy-collector-pytest6.patch, wrapt-pr161-py39tests.patch (upstream) + +------------------------------------------------------------------- +Sat Mar 20 16:50:08 UTC 2021 - Ben Greiner + +- Fix python39 test suite failures + * wrapt-pr161-py39tests.patch + * gh#GrahamDumpleton/wrapt#161 + +------------------------------------------------------------------- +Fri Dec 4 00:37:53 UTC 2020 - Benjamin Greiner + +- Fix python3.6 build with pytest 6 + * fix-dummy-collector-pytest6.patch + * gh#GrahamDumpleton/wrapt#168 + +------------------------------------------------------------------- +Mon Mar 16 11:01:55 UTC 2020 - Dirk Mueller + +- update to 1.12.1: + * Applying a function wrapper to a static method of a class using the + ``wrap_function_wrapper()`` function, or wrapper for the same, wasn't + being done correctly when the static method was the immediate child of + the target object. It was working when the name path had multiple name + components. A failure would subsequently occur when the static method + was called via an instance of the class, rather than the class. + +------------------------------------------------------------------- +Mon Mar 9 16:25:43 UTC 2020 - Dirk Mueller + +- update to 1.12.0: + * Provided that you only want to support Python 3.7, when deriving from + a base class which has a decorator applied to it, you no longer need + to access the true type of the base class using ``__wrapped__`` in + the inherited class list of the derived class. + * When using the ``synchronized`` decorator on instance methods of a + class, if the class declared special methods to override the result for + when the class instance was tested as a boolean so that it returned + ``False`` all the time, the synchronized method would fail when called. + * When using an adapter function to change the signature of the decorated + function, ``inspect.signature()`` was returning the wrong signature + when an instance method was inspected by accessing the method via the + class type. + +------------------------------------------------------------------- +Mon Jul 22 11:37:01 UTC 2019 - Tomáš Chvátal + +- Update to 1.11.2: + * Fix possible crash when garbage collection kicks in when invoking a destructor of wrapped object. + +------------------------------------------------------------------- +Mon Mar 11 13:28:24 UTC 2019 - Tomáš Chvátal + +- Update to 1.11.1: + * Many bugfixes all around + * see changes.rst for detailed list +- Switch to github to include tests + +------------------------------------------------------------------- +Sun Jul 9 10:26:29 UTC 2017 - adrian@suse.de + +- update to version 1.10.10: + * Added back missing description and categorisations when releasing + to PyPi. + * Code for inspect.getargspec() when using Python 2.6 was missing + import of sys module. + +------------------------------------------------------------------- +Mon Feb 27 13:54:07 UTC 2017 - jmatejek@suse.com + +- update for singlespec + +------------------------------------------------------------------- +Thu Sep 1 05:30:31 UTC 2016 - tbechtold@suse.com + +update to version 1.10.8 + * Increment version to 1.10.8. + * Fix modulo operator on ObjectProxy + * Increment version to 1.10.7. + * Document mod operator bug in Python variant of object proxy. + * Update copyright year. + * Fix tests for floordiv and mod. + * Remove reference to inspect.getargspec() as removed in Python 3.6. #64 +- Use pypi.io as Source url + +------------------------------------------------------------------- +Tue Feb 16 08:25:35 UTC 2016 - michael@stroeder.com + +- update to 1.10.6 + +------------------------------------------------------------------- +Tue Nov 4 16:03:54 UTC 2014 - hpj@urpla.net + +- version 1.9: initial build + diff --git a/python-wrapt.spec b/python-wrapt.spec new file mode 100644 index 0000000..d5c1e59 --- /dev/null +++ b/python-wrapt.spec @@ -0,0 +1,80 @@ +# +# spec file for package python-wrapt +# +# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2015 LISA GmbH, Bingen, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-wrapt +Version: 1.17.2 +Release: 0 +Summary: A Python module for decorators, wrappers and monkey patching +License: BSD-2-Clause +Group: Development/Languages/Python +URL: https://github.com/GrahamDumpleton/wrapt +Source: https://github.com/GrahamDumpleton/wrapt/archive/%{version}.tar.gz +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +%python_subpackages + +%description +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. + +The **wrapt** module focuses very much on correctness. It therefore goes +way beyond existing mechanisms such as ``functools.wraps()`` to ensure that +decorators preserve introspectability, signatures, type checking abilities +etc. The decorators that can be constructed using this module will work in +far more scenarios than typical decorators and provide more predictable and +consistent behaviour. + +To ensure that the overhead is as minimal as possible, a C extension module +is used for performance critical components. An automatic fallback to a +pure Python implementation is also provided where a target system does not +have a compiler to allow the C extension to be compiled. + +Documentation +------------- + +For further information on the **wrapt** module see: + +* http://wrapt.readthedocs.org/ + +%prep +%autosetup -p1 -n wrapt-%{version} + +%build +export CFLAGS="%{optflags}" +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +%pytest_arch + +%files %{python_files} +%license LICENSE +%doc README.rst docs/changes.rst +%{python_sitearch}/wrapt +%{python_sitearch}/wrapt-%{version}*-info + +%changelog