Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mocket for openSUSE:Factory checked in at 2021-09-16 23:14:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mocket (Old) and /work/SRC/openSUSE:Factory/.python-mocket.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mocket" Thu Sep 16 23:14:33 2021 rev:15 rq:918466 version:3.9.44 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mocket/python-mocket.changes 2021-08-11 11:47:07.317753371 +0200 +++ /work/SRC/openSUSE:Factory/.python-mocket.new.1899/python-mocket.changes 2021-09-16 23:16:57.447940286 +0200 @@ -1,0 +2,17 @@ +Sat Sep 4 18:19:20 UTC 2021 - Sebastian Wagner <sebix+novell....@sebix.at> + +- remove obsolete kwsyntax.patch. + +------------------------------------------------------------------- +Sat Sep 4 18:10:11 UTC 2021 - Sebastian Wagner <sebix+novell....@sebix.at> + +- Update to version 3.9.44: + - Update __init__.py + - Removing the constraint for `decorator`. + - Update __init__.py (#155) + - Patch from PR #150 (Refactored the mocketize decorator) (#153) + * Patch from PR #150. Thanks to @micheles form the hints. + * Complete refactor for using `decorator>=5`. + - Update README.rs + +------------------------------------------------------------------- Old: ---- kwsyntax.patch mocket-3.9.42.tar.gz New: ---- mocket-3.9.44.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mocket.spec ++++++ --- /var/tmp/diff_new_pack.imRdgy/_old 2021-09-16 23:16:57.903940758 +0200 +++ /var/tmp/diff_new_pack.imRdgy/_new 2021-09-16 23:16:57.907940763 +0200 @@ -26,21 +26,20 @@ %bcond_with test %endif Name: python-mocket%{psuffix} -Version: 3.9.42 +Version: 3.9.44 Release: 0 Summary: Python socket mock framework License: BSD-3-Clause URL: https://github.com/mindflayer/python-mocket Source0: https://files.pythonhosted.org/packages/source/m/mocket/mocket-%{version}.tar.gz -Patch0: kwsyntax.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-decorator +Requires: python-decorator >= 4 Requires: python-http-parser >= 0.9.0 -Requires: python-python-magic +Requires: python-python-magic >= 0.4.5 Requires: python-six -Requires: python-urllib3 +Requires: python-urllib3 >= 1.25.3 Suggests: python-gevent Suggests: python-pook >= 0.2.1 Suggests: python-redis @@ -81,7 +80,6 @@ %prep %setup -q -n mocket-%{version} -%autopatch -p1 sed -i '/cov/ d' setup.cfg sed -i '/pipenv/ d' setup.py sed -i 's/==.*$//' requirements.txt ++++++ mocket-3.9.42.tar.gz -> mocket-3.9.44.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/PKG-INFO new/mocket-3.9.44/PKG-INFO --- old/mocket-3.9.42/PKG-INFO 2021-06-10 14:26:00.610983100 +0200 +++ new/mocket-3.9.44/PKG-INFO 2021-08-31 12:59:25.871479700 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mocket -Version: 3.9.42 +Version: 3.9.44 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Home-page: https://github.com/mindflayer/python-mocket Author: Giorgio Salluzzo @@ -47,7 +47,7 @@ ------------------------- for all kinds of socket *animals*, web-clients included - with gevent/asyncio/SSL support -...and then MicroPython's *urequest* (*mocket >= 3.9.1*) +...and then MicroPython's *urequests* (*mocket >= 3.9.1*) Versioning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/README.rst new/mocket-3.9.44/README.rst --- old/mocket-3.9.42/README.rst 2021-03-20 19:51:56.000000000 +0100 +++ new/mocket-3.9.44/README.rst 2021-08-31 12:37:51.000000000 +0200 @@ -19,7 +19,7 @@ ------------------------- for all kinds of socket *animals*, web-clients included - with gevent/asyncio/SSL support -...and then MicroPython's *urequest* (*mocket >= 3.9.1*) +...and then MicroPython's *urequests* (*mocket >= 3.9.1*) Versioning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/mocket/__init__.py new/mocket-3.9.44/mocket/__init__.py --- old/mocket-3.9.42/mocket/__init__.py 2021-06-10 14:22:06.000000000 +0200 +++ new/mocket-3.9.44/mocket/__init__.py 2021-08-31 12:59:11.000000000 +0200 @@ -2,4 +2,4 @@ __all__ = ("mocketize", "Mocket", "MocketEntry", "Mocketizer") -__version__ = "3.9.42" +__version__ = "3.9.44" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/mocket/async_mocket.py new/mocket-3.9.44/mocket/async_mocket.py --- old/mocket-3.9.42/mocket/async_mocket.py 2021-06-10 14:17:58.000000000 +0200 +++ new/mocket-3.9.44/mocket/async_mocket.py 2021-08-31 12:41:08.000000000 +0200 @@ -1,19 +1,31 @@ -from mocket import Mocketizer - +import decorator -def get_async_mocketize(): - class AsyncMocketizer(Mocketizer): - async def __aenter__(*args, **kwargs): - return Mocketizer.__enter__(*args, **kwargs) - - async def __aexit__(*args, **kwargs): - return Mocketizer.__exit__(*args, **kwargs) +from mocket import Mocketizer - @staticmethod - def async_wrap(*args, **kwargs): - return Mocketizer.wrap(*args, **kwargs) - return AsyncMocketizer.async_wrap +async def wrapper(test, cls=Mocketizer, truesocket_recording_dir=None, *args, **kwargs): + instance = args[0] if args else None + namespace = None + if truesocket_recording_dir: + namespace = ".".join( + ( + instance.__class__.__module__, + instance.__class__.__name__, + test.__name__, + ) + ) + async with cls( + instance, + namespace=namespace, + truesocket_recording_dir=truesocket_recording_dir, + ): + return await test(*args, **kwargs) + + +if decorator.__version__ < "5": + async_mocketize = decorator.decorator(wrapper) +else: + async_mocketize = decorator.decorator(wrapper, kwsyntax=True) -async_mocketize = get_async_mocketize() +__all__ = ("async_mocketize",) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/mocket/mocket.py new/mocket-3.9.44/mocket/mocket.py --- old/mocket-3.9.42/mocket/mocket.py 2021-06-10 14:17:58.000000000 +0200 +++ new/mocket-3.9.44/mocket/mocket.py 2021-08-31 12:41:08.000000000 +0200 @@ -588,47 +588,59 @@ self.truesocket_recording_dir = truesocket_recording_dir self.namespace = namespace or text_type(id(self)) - def __enter__(self): + def enter(self): Mocket.enable( namespace=self.namespace, truesocket_recording_dir=self.truesocket_recording_dir, ) if self.instance: self.check_and_call("mocketize_setup") + + def __enter__(self): + self.enter() return self - def __exit__(self, type, value, tb): + def exit(self): if self.instance: self.check_and_call("mocketize_teardown") Mocket.disable() + def __exit__(self, type, value, tb): + self.exit() + + async def __aenter__(self, *args, **kwargs): + self.enter() + return self + + async def __aexit__(self, *args, **kwargs): + self.exit() + def check_and_call(self, method): method = getattr(self.instance, method, None) if callable(method): method() - @classmethod - def wrap(cls, test=None, truesocket_recording_dir=None): - def wrapper(t, *args, **kw): - instance = args[0] if args else None - namespace = None - if truesocket_recording_dir: - namespace = ".".join( - ( - instance.__class__.__module__, - instance.__class__.__name__, - t.__name__, - ) - ) - with cls( - instance, - namespace=namespace, - truesocket_recording_dir=truesocket_recording_dir, - ): - t(*args, **kw) - return wrapper - return decorator.decorator(wrapper, test) +def wrapper(test, cls=Mocketizer, truesocket_recording_dir=None, *args, **kwargs): + instance = args[0] if args else None + namespace = None + if truesocket_recording_dir: + namespace = ".".join( + ( + instance.__class__.__module__, + instance.__class__.__name__, + test.__name__, + ) + ) + with cls( + instance, + namespace=namespace, + truesocket_recording_dir=truesocket_recording_dir, + ): + return test(*args, **kwargs) -mocketize = Mocketizer.wrap +if decorator.__version__ < "5": + mocketize = decorator.decorator(wrapper) +else: + mocketize = decorator.decorator(wrapper, kwsyntax=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/mocket/plugins/httpretty/__init__.py new/mocket-3.9.44/mocket/plugins/httpretty/__init__.py --- old/mocket-3.9.42/mocket/plugins/httpretty/__init__.py 2021-03-20 19:51:56.000000000 +0100 +++ new/mocket-3.9.44/mocket/plugins/httpretty/__init__.py 2021-08-31 12:41:08.000000000 +0200 @@ -1,6 +1,5 @@ -from sys import version_info - from mocket import Mocket, mocketize +from mocket.async_mocket import async_mocketize from mocket.compat import byte_type, text_type from mocket.mockhttp import Entry as MocketHttpEntry from mocket.mockhttp import Request as MocketHttpRequest @@ -44,12 +43,7 @@ activate = mocketize httprettified = mocketize - -major, minor = version_info[:2] -if major == 3 and minor >= 5: - from mocket.async_mocket import get_async_mocketize - - async_httprettified = get_async_mocketize() +async_httprettified = async_mocketize enable = Mocket.enable disable = Mocket.disable @@ -128,6 +122,7 @@ __all__ = ( "HTTPretty", "activate", + "async_httprettified", "httprettified", "enable", "disable", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/mocket.egg-info/PKG-INFO new/mocket-3.9.44/mocket.egg-info/PKG-INFO --- old/mocket-3.9.42/mocket.egg-info/PKG-INFO 2021-06-10 14:26:00.000000000 +0200 +++ new/mocket-3.9.44/mocket.egg-info/PKG-INFO 2021-08-31 12:59:25.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mocket -Version: 3.9.42 +Version: 3.9.44 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Home-page: https://github.com/mindflayer/python-mocket Author: Giorgio Salluzzo @@ -47,7 +47,7 @@ ------------------------- for all kinds of socket *animals*, web-clients included - with gevent/asyncio/SSL support -...and then MicroPython's *urequest* (*mocket >= 3.9.1*) +...and then MicroPython's *urequests* (*mocket >= 3.9.1*) Versioning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/mocket.egg-info/requires.txt new/mocket-3.9.44/mocket.egg-info/requires.txt --- old/mocket-3.9.42/mocket.egg-info/requires.txt 2021-06-10 14:26:00.000000000 +0200 +++ new/mocket-3.9.44/mocket.egg-info/requires.txt 2021-08-31 12:59:25.000000000 +0200 @@ -1,5 +1,5 @@ python-magic>=0.4.5 -decorator<5,>=4.0.0 +decorator>=4.0.0 urllib3>=1.25.3 http-parser>=0.9.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.9.42/requirements.txt new/mocket-3.9.44/requirements.txt --- old/mocket-3.9.42/requirements.txt 2021-06-10 14:25:58.000000000 +0200 +++ new/mocket-3.9.44/requirements.txt 2021-08-31 12:59:23.000000000 +0200 @@ -1,4 +1,4 @@ python-magic>=0.4.5 -decorator>=4.0.0,<5 +decorator>=4.0.0 urllib3>=1.25.3 http-parser>=0.9.0