From 1c268d0299e72dd814638687e60e241f14a351e5ca89ec36a21a89e7da7f55c0 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 12 Jan 2023 11:12:31 +0000 Subject: [PATCH] - Add py311-compat.patch to fix python-3.11 compatibility - Update to 1.1.0: * chore(version): bump minor v1.1.0 * Switch to Python >= 3.5 and fix latest aiohttp compatability (#83) * fix: remove print call (#81) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pook?expand=0&rev=12 --- pook-1.0.2.tar.gz | 3 --- pook-1.1.0.tar.gz | 3 +++ py311-compat.patch | 38 ++++++++++++++++++++++++++++++++++++++ python-pook.changes | 9 +++++++++ python-pook.spec | 12 +++++++----- 5 files changed, 57 insertions(+), 8 deletions(-) delete mode 100644 pook-1.0.2.tar.gz create mode 100644 pook-1.1.0.tar.gz create mode 100644 py311-compat.patch diff --git a/pook-1.0.2.tar.gz b/pook-1.0.2.tar.gz deleted file mode 100644 index e7fdbc5..0000000 --- a/pook-1.0.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f28112db062d17db245b351c80f2bb5bf1e56ebfa93d3d75cc44f500c15c40eb -size 42069 diff --git a/pook-1.1.0.tar.gz b/pook-1.1.0.tar.gz new file mode 100644 index 0000000..a79b939 --- /dev/null +++ b/pook-1.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bda6e301706945e9769bf5aaba01063229aadd7bc6c244a83e2257ece695536c +size 41879 diff --git a/py311-compat.patch b/py311-compat.patch new file mode 100644 index 0000000..8e3e173 --- /dev/null +++ b/py311-compat.patch @@ -0,0 +1,38 @@ +Index: pook-1.1.0/pook/activate_async.py +=================================================================== +--- pook-1.1.0.orig/pook/activate_async.py ++++ pook-1.1.0/pook/activate_async.py +@@ -1,5 +1,5 @@ + import functools +-from asyncio import iscoroutinefunction, coroutine ++from asyncio import iscoroutinefunction + + + def activate_async(fn, _engine): +@@ -13,13 +13,13 @@ def activate_async(fn, _engine): + Returns: + function: decorator wrapper function. + """ +- @coroutine + @functools.wraps(fn) +- def wrapper(*args, **kw): ++ async def wrapper(*args, **kw): + _engine.activate() + try: + if iscoroutinefunction(fn): +- yield from fn(*args, **kw) # noqa ++ async for v in fn(*args, **kw): ++ yield v + else: + fn(*args, **kw) + finally: +Index: pook-1.1.0/tests/unit/mock_test.py +=================================================================== +--- pook-1.1.0.orig/tests/unit/mock_test.py ++++ pook-1.1.0/tests/unit/mock_test.py +@@ -19,4 +19,4 @@ def test_mock_url(mock): + + + def test_new_response(mock): +- assert(mock.reply() != mock.reply(new_response=True, json={})) ++ assert mock.reply() != mock.reply(new_response=True, json={}) diff --git a/python-pook.changes b/python-pook.changes index 4f3f639..ab4c3f7 100644 --- a/python-pook.changes +++ b/python-pook.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Jan 12 11:04:56 UTC 2023 - Daniel Garcia + +- Add py311-compat.patch to fix python-3.11 compatibility +- Update to 1.1.0: + * chore(version): bump minor v1.1.0 + * Switch to Python >= 3.5 and fix latest aiohttp compatability (#83) + * fix: remove print call (#81) + ------------------------------------------------------------------- Wed Apr 6 09:52:49 UTC 2022 - pgajdos@suse.com diff --git a/python-pook.spec b/python-pook.spec index 2046a81..22e6b00 100644 --- a/python-pook.spec +++ b/python-pook.spec @@ -1,7 +1,7 @@ # # spec file for package python-pook # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,16 +16,17 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} # requires python-aiohttp %define skip_python2 1 Name: python-pook -Version: 1.0.2 +Version: 1.1.0 Release: 0 Summary: HTTP traffic mocking and expectations License: MIT URL: https://github.com/h2non/pook Source: https://files.pythonhosted.org/packages/source/p/pook/pook-%{version}.tar.gz +# PATCH-FIX-OPENSUSE py311-compat.patch gh#h2non/pook#83 +Patch: py311-compat.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -50,7 +51,7 @@ BuildRequires: %{python_module xmltodict >= 0.10.2} HTTP traffic mocking and expectations. %prep -%setup -q -n pook-%{version} +%autosetup -p1 -n pook-%{version} rm -f setup.cfg pytest.ini tox.ini # Assist unittest on Python 2 @@ -77,6 +78,7 @@ $python -m unittest tests.integration.engines.unittest_suite %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/pook +%{python_sitelib}/pook-%{version}*-info %changelog