Hello community, here is the log from the commit of package python-wrapt for openSUSE:Factory checked in at 2017-07-21 22:46:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-wrapt (Old) and /work/SRC/openSUSE:Factory/.python-wrapt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wrapt" Fri Jul 21 22:46:46 2017 rev:5 rq:509027 version:1.10.10 Changes: -------- --- /work/SRC/openSUSE:Factory/python-wrapt/python-wrapt.changes 2017-03-18 20:50:45.328136622 +0100 +++ /work/SRC/openSUSE:Factory/.python-wrapt.new/python-wrapt.changes 2017-07-21 22:46:49.218555849 +0200 @@ -1,0 +2,5 @@ +Sun Jul 9 10:26:29 UTC 2017 - adr...@suse.de + +- update to version 1.10.10 + +------------------------------------------------------------------- Old: ---- wrapt-1.10.8.tar.gz New: ---- wrapt-1.10.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-wrapt.spec ++++++ --- /var/tmp/diff_new_pack.3ClIST/_old 2017-07-21 22:46:49.926455991 +0200 +++ /var/tmp/diff_new_pack.3ClIST/_new 2017-07-21 22:46:49.930455427 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-wrapt -Version: 1.10.8 +Version: 1.10.10 Release: 0 Summary: A Python module for decorators, wrappers and monkey patching License: BSD-2-Clause ++++++ wrapt-1.10.8.tar.gz -> wrapt-1.10.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/PKG-INFO new/wrapt-1.10.10/PKG-INFO --- old/wrapt-1.10.8/PKG-INFO 2016-04-11 01:34:05.000000000 +0200 +++ new/wrapt-1.10.10/PKG-INFO 2017-03-15 01:38:30.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.0 +Metadata-Version: 1.1 Name: wrapt -Version: 1.10.8 +Version: 1.10.10 Summary: Module for decorators, wrappers and monkey patching. Home-page: https://github.com/GrahamDumpleton/wrapt Author: Graham Dumpleton @@ -11,11 +11,137 @@ |Travis| |Coveralls| |PyPI| - A Python module for decorators, wrappers and monkey patching. + 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/ + + Quick Start + ----------- + + To implement your decorator you need to first define a wrapper function. + This will be called each time a decorated function is called. The wrapper + function needs to take four positional arguments: + + * ``wrapped`` - The wrapped function which in turns needs to be called by your wrapper function. + * ``instance`` - The object to which the wrapped function was bound when it was called. + * ``args`` - The list of positional arguments supplied when the decorated function was called. + * ``kwargs`` - The dictionary of keyword arguments supplied when the decorated function was called. + + The wrapper function would do whatever it needs to, but would usually in + turn call the wrapped function that is passed in via the ``wrapped`` + argument. + + The decorator ``@wrapt.decorator`` then needs to be applied to the wrapper + function to convert it into a decorator which can in turn be applied to + other functions. + + :: + + import wrapt + + @wrapt.decorator + def pass_through(wrapped, instance, args, kwargs): + return wrapped(*args, **kwargs) + + @pass_through + def function(): + pass + + If you wish to implement a decorator which accepts arguments, then wrap the + definition of the decorator in a function closure. Any arguments supplied + to the outer function when the decorator is applied, will be available to + the inner wrapper when the wrapped function is called. + + :: + + import wrapt + + def with_arguments(myarg1, myarg2): + @wrapt.decorator + def wrapper(wrapped, instance, args, kwargs): + return wrapped(*args, **kwargs) + return wrapper + + @with_arguments(1, 2) + def function(): + pass + + When applied to a normal function or static method, the wrapper function + when called will be passed ``None`` as the ``instance`` argument. + + When applied to an instance method, the wrapper function when called will + be passed the instance of the class the method is being called on as the + ``instance`` argument. This will be the case even when the instance method + was called explicitly via the class and the instance passed as the first + argument. That is, the instance will never be passed as part of ``args``. + + When applied to a class method, the wrapper function when called will be + passed the class type as the ``instance`` argument. + + When applied to a class, the wrapper function when called will be passed + ``None`` as the ``instance`` argument. The ``wrapped`` argument in this + case will be the class. + + The above rules can be summarised with the following example. + + :: + + import inspect + + @wrapt.decorator + def universal(wrapped, instance, args, kwargs): + if instance is None: + if inspect.isclass(wrapped): + # Decorator was applied to a class. + return wrapped(*args, **kwargs) + else: + # Decorator was applied to a function or staticmethod. + return wrapped(*args, **kwargs) + else: + if inspect.isclass(instance): + # Decorator was applied to a classmethod. + return wrapped(*args, **kwargs) + else: + # Decorator was applied to an instancemethod. + return wrapped(*args, **kwargs) + + Using these checks it is therefore possible to create a universal decorator + that can be applied in all situations. It is no longer necessary to create + different variants of decorators for normal functions and instance methods, + or use additional wrappers to convert a function decorator into one that + will work for instance methods. + + In all cases, the wrapped function passed to the wrapper function is called + in the same way, with ``args`` and ``kwargs`` being passed. The + ``instance`` argument doesn't need to be used in calling the wrapped + function. - For full documentation see: + Repository + ---------- - http://wrapt.readthedocs.org + Full source code for the **wrapt** module, including documentation files + and unit tests, can be obtained from github. + + * https://github.com/GrahamDumpleton/wrapt .. |Travis| image:: https://img.shields.io/travis/GrahamDumpleton/wrapt/develop.svg?style=plastic :target: https://travis-ci.org/GrahamDumpleton/wrapt?branch=develop @@ -25,3 +151,13 @@ :target: https://pypi.python.org/pypi/wrapt Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/README.rst new/wrapt-1.10.10/README.rst --- old/wrapt-1.10.8/README.rst 2015-12-09 00:05:05.000000000 +0100 +++ new/wrapt-1.10.10/README.rst 2017-03-15 01:37:55.000000000 +0100 @@ -3,11 +3,137 @@ |Travis| |Coveralls| |PyPI| -A Python module for decorators, wrappers and monkey patching. +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. -For full documentation see: +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. - http://wrapt.readthedocs.org +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/ + +Quick Start +----------- + +To implement your decorator you need to first define a wrapper function. +This will be called each time a decorated function is called. The wrapper +function needs to take four positional arguments: + +* ``wrapped`` - The wrapped function which in turns needs to be called by your wrapper function. +* ``instance`` - The object to which the wrapped function was bound when it was called. +* ``args`` - The list of positional arguments supplied when the decorated function was called. +* ``kwargs`` - The dictionary of keyword arguments supplied when the decorated function was called. + +The wrapper function would do whatever it needs to, but would usually in +turn call the wrapped function that is passed in via the ``wrapped`` +argument. + +The decorator ``@wrapt.decorator`` then needs to be applied to the wrapper +function to convert it into a decorator which can in turn be applied to +other functions. + +:: + + import wrapt + + @wrapt.decorator + def pass_through(wrapped, instance, args, kwargs): + return wrapped(*args, **kwargs) + + @pass_through + def function(): + pass + +If you wish to implement a decorator which accepts arguments, then wrap the +definition of the decorator in a function closure. Any arguments supplied +to the outer function when the decorator is applied, will be available to +the inner wrapper when the wrapped function is called. + +:: + + import wrapt + + def with_arguments(myarg1, myarg2): + @wrapt.decorator + def wrapper(wrapped, instance, args, kwargs): + return wrapped(*args, **kwargs) + return wrapper + + @with_arguments(1, 2) + def function(): + pass + +When applied to a normal function or static method, the wrapper function +when called will be passed ``None`` as the ``instance`` argument. + +When applied to an instance method, the wrapper function when called will +be passed the instance of the class the method is being called on as the +``instance`` argument. This will be the case even when the instance method +was called explicitly via the class and the instance passed as the first +argument. That is, the instance will never be passed as part of ``args``. + +When applied to a class method, the wrapper function when called will be +passed the class type as the ``instance`` argument. + +When applied to a class, the wrapper function when called will be passed +``None`` as the ``instance`` argument. The ``wrapped`` argument in this +case will be the class. + +The above rules can be summarised with the following example. + +:: + + import inspect + + @wrapt.decorator + def universal(wrapped, instance, args, kwargs): + if instance is None: + if inspect.isclass(wrapped): + # Decorator was applied to a class. + return wrapped(*args, **kwargs) + else: + # Decorator was applied to a function or staticmethod. + return wrapped(*args, **kwargs) + else: + if inspect.isclass(instance): + # Decorator was applied to a classmethod. + return wrapped(*args, **kwargs) + else: + # Decorator was applied to an instancemethod. + return wrapped(*args, **kwargs) + +Using these checks it is therefore possible to create a universal decorator +that can be applied in all situations. It is no longer necessary to create +different variants of decorators for normal functions and instance methods, +or use additional wrappers to convert a function decorator into one that +will work for instance methods. + +In all cases, the wrapped function passed to the wrapper function is called +in the same way, with ``args`` and ``kwargs`` being passed. The +``instance`` argument doesn't need to be used in calling the wrapped +function. + +Repository +---------- + +Full source code for the **wrapt** module, including documentation files +and unit tests, can be obtained from github. + +* https://github.com/GrahamDumpleton/wrapt .. |Travis| image:: https://img.shields.io/travis/GrahamDumpleton/wrapt/develop.svg?style=plastic :target: https://travis-ci.org/GrahamDumpleton/wrapt?branch=develop diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/setup.py new/wrapt-1.10.10/setup.py --- old/wrapt-1.10.8/setup.py 2016-04-11 01:32:33.000000000 +0200 +++ new/wrapt-1.10.10/setup.py 2017-03-15 01:37:55.000000000 +0100 @@ -11,7 +11,7 @@ if sys.platform == 'win32': build_ext_errors = (CCompilerError, DistutilsExecError, - DistutilsPlatformError, IOError) + DistutilsPlatformError, IOError, OSError) else: build_ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError) @@ -32,17 +32,31 @@ except build_ext_errors: raise BuildExtFailed() +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'License :: OSI Approved :: BSD License', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', +] + setup_kwargs = dict( - name = 'wrapt', - version = '1.10.8', - description = 'Module for decorators, wrappers and monkey patching.', - long_description = open('README.rst').read(), - author = 'Graham Dumpleton', - author_email = 'graham.dumple...@gmail.com', - license = 'BSD', - url = 'https://github.com/GrahamDumpleton/wrapt', - packages = ['wrapt'], - package_dir = {'': 'src'}, + name='wrapt', + version='1.10.10', + description='Module for decorators, wrappers and monkey patching.', + long_description=open('README.rst').read(), + author='Graham Dumpleton', + author_email='graham.dumple...@gmail.com', + license='BSD', + classifiers=classifiers, + url='https://github.com/GrahamDumpleton/wrapt', + packages=['wrapt'], + package_dir={'': 'src'}, ) def run_setup(with_extensions): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/src/wrapt/__init__.py new/wrapt-1.10.10/src/wrapt/__init__.py --- old/wrapt-1.10.8/src/wrapt/__init__.py 2016-04-11 01:32:33.000000000 +0200 +++ new/wrapt-1.10.10/src/wrapt/__init__.py 2017-03-15 01:37:55.000000000 +0100 @@ -1,4 +1,4 @@ -__version_info__ = ('1', '10', '8') +__version_info__ = ('1', '10', '10') __version__ = '.'.join(__version_info__) from .wrappers import (ObjectProxy, CallableObjectProxy, FunctionWrapper, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/src/wrapt/_wrappers.c new/wrapt-1.10.10/src/wrapt/_wrappers.c --- old/wrapt-1.10.8/src/wrapt/_wrappers.c 2015-12-09 00:05:05.000000000 +0100 +++ new/wrapt-1.10.10/src/wrapt/_wrappers.c 2017-03-15 01:02:23.000000000 +0100 @@ -2587,7 +2587,7 @@ return result; } -/* ------------------------------------------------------------------------- */; +/* ------------------------------------------------------------------------- */ static PyGetSetDef WraptFunctionWrapper_getset[] = { { "__module__", (getter)WraptObjectProxy_get_module, @@ -2645,7 +2645,7 @@ 0, /*tp_is_gc*/ }; -/* ------------------------------------------------------------------------- */; +/* ------------------------------------------------------------------------- */ #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { @@ -2678,7 +2678,7 @@ if (PyType_Ready(&WraptObjectProxy_Type) < 0) return NULL; - /* Ensure that inheritence relationships specified. */ + /* Ensure that inheritance relationships specified. */ WraptCallableObjectProxy_Type.tp_base = &WraptObjectProxy_Type; WraptFunctionWrapperBase_Type.tp_base = &WraptObjectProxy_Type; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/src/wrapt/arguments.py new/wrapt-1.10.10/src/wrapt/arguments.py --- old/wrapt-1.10.8/src/wrapt/arguments.py 2015-12-09 00:05:05.000000000 +0100 +++ new/wrapt-1.10.10/src/wrapt/arguments.py 2017-03-15 01:02:23.000000000 +0100 @@ -4,6 +4,7 @@ # of the PSF license used for Python 2.7. from inspect import getargspec, ismethod +import sys def getcallargs(func, *positional, **named): """Get the mapping of arguments to values. @@ -29,7 +30,7 @@ except StopIteration: raise ValueError('need more than %d %s to unpack' % (i, 'values' if i > 1 else 'value')) - assign(subarg,subvalue) + assign(subarg, subvalue) try: next(value) except StopIteration: @@ -37,7 +38,7 @@ else: raise ValueError('too many values to unpack') def is_assigned(arg): - if isinstance(arg,str): + if isinstance(arg, str): return arg in arg2value return arg in assigned_tuple_params if ismethod(func) and func.im_self is not None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/src/wrapt/decorators.py new/wrapt-1.10.10/src/wrapt/decorators.py --- old/wrapt-1.10.8/src/wrapt/decorators.py 2016-04-11 01:32:33.000000000 +0200 +++ new/wrapt-1.10.10/src/wrapt/decorators.py 2017-03-15 01:02:23.000000000 +0100 @@ -255,7 +255,7 @@ # we need to first check that use of the decorator # hadn't been disabled by a simple boolean. If it was, # the target function to be wrapped is returned instead. - + _enabled = enabled if type(_enabled) is bool: if not _enabled: @@ -424,7 +424,7 @@ if hasattr(wrapped, 'acquire') and hasattr(wrapped, 'release'): # We remember what the original lock is and then return a new - # decorator which acceses and locks it. When returning the new + # decorator which accesses and locks it. When returning the new # decorator we wrap it with an object proxy so we can override # the context manager methods in case it is being used to wrap # synchronized statements with a 'with' statement. @@ -453,7 +453,7 @@ # Following only apply when the lock is being created automatically # based on the context of what was supplied. In this case we supply # a final decorator, but need to use FunctionWrapper directly as we - # want to derive from it to add context manager methods in in case it is + # want to derive from it to add context manager methods in case it is # being used to wrap synchronized statements with a 'with' statement. def _synchronized_lock(context): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/src/wrapt/importer.py new/wrapt-1.10.10/src/wrapt/importer.py --- old/wrapt-1.10.8/src/wrapt/importer.py 2015-12-09 00:05:05.000000000 +0100 +++ new/wrapt-1.10.10/src/wrapt/importer.py 2017-03-15 01:02:23.000000000 +0100 @@ -9,7 +9,7 @@ PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 -if PY3: +if PY3: import importlib string_types = str, else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wrapt-1.10.8/src/wrapt/wrappers.py new/wrapt-1.10.10/src/wrapt/wrappers.py --- old/wrapt-1.10.8/src/wrapt/wrappers.py 2016-03-31 07:49:07.000000000 +0200 +++ new/wrapt-1.10.10/src/wrapt/wrappers.py 2017-03-15 01:02:23.000000000 +0100 @@ -18,14 +18,14 @@ class _ObjectProxyMethods(object): - # We use properties to override the values of __module__ and - # __doc__. If we add these in ObjectProxy, the derived class - # __dict__ will still be setup to have string variants of these - # attributes and the rules of descriptors means that they appear to - # take precedence over the properties in the base class. To avoid - # that, we copy the properties into the derived class type itself - # via a meta class. In that way the properties will always take - # precedence. + # We use properties to override the values of __module__ and + # __doc__. If we add these in ObjectProxy, the derived class + # __dict__ will still be setup to have string variants of these + # attributes and the rules of descriptors means that they appear to + # take precedence over the properties in the base class. To avoid + # that, we copy the properties into the derived class type itself + # via a meta class. In that way the properties will always take + # precedence. @property def __module__(self): @@ -60,15 +60,15 @@ return self.__wrapped__.__weakref__ class _ObjectProxyMetaType(type): - def __new__(cls, name, bases, dictionary): - # Copy our special properties into the class so that they - # always take precedence over attributes of the same name added - # during construction of a derived class. This is to save - # duplicating the implementation for them in all derived classes. + def __new__(cls, name, bases, dictionary): + # Copy our special properties into the class so that they + # always take precedence over attributes of the same name added + # during construction of a derived class. This is to save + # duplicating the implementation for them in all derived classes. - dictionary.update(vars(_ObjectProxyMethods)) + dictionary.update(vars(_ObjectProxyMethods)) - return type.__new__(cls, name, bases, dictionary) + return type.__new__(cls, name, bases, dictionary) class ObjectProxy(with_metaclass(_ObjectProxyMetaType)): @@ -418,7 +418,7 @@ class _FunctionWrapperBase(ObjectProxy): __slots__ = ('_self_instance', '_self_wrapper', '_self_enabled', - '_self_binding', '_self_parent') + '_self_binding', '_self_parent') def __init__(self, wrapped, instance, wrapper, enabled=None, binding='function', parent=None): @@ -440,7 +440,7 @@ # # The distinguishing attribute which determines whether we are # being called in an unbound or bound wrapper is the parent - # attribute. If binding has never occured, then the parent will + # attribute. If binding has never occurred, then the parent will # be None. # # First therefore, is if we are called in an unbound wrapper. In @@ -467,7 +467,7 @@ return self - # Now we have the case of binding occuring a second time on what + # Now we have the case of binding occurring a second time on what # was already a bound function. In this case we would usually # return ourselves again. This mirrors what Python does. # @@ -702,7 +702,7 @@ # to work. For the case of a class we therefore access # the __dict__ directly. To cope though with the wrong # class being given to us, or a method being moved into - # a base class, we need to walk the class heirarchy to + # a base class, we need to walk the class hierarchy to # work out exactly which __dict__ the method was defined # in, as accessing it from __dict__ will fail if it was # not actually on the class given. Fallback to using