- 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
This commit is contained in:
Daniel Garcia 2023-01-12 11:12:31 +00:00 committed by Git OBS Bridge
parent ce3a119a3f
commit 1c268d0299
5 changed files with 57 additions and 8 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f28112db062d17db245b351c80f2bb5bf1e56ebfa93d3d75cc44f500c15c40eb
size 42069

3
pook-1.1.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bda6e301706945e9769bf5aaba01063229aadd7bc6c244a83e2257ece695536c
size 41879

38
py311-compat.patch Normal file
View File

@ -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={})

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Jan 12 11:04:56 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- 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 Wed Apr 6 09:52:49 UTC 2022 - pgajdos@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-pook # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -16,16 +16,17 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# requires python-aiohttp # requires python-aiohttp
%define skip_python2 1 %define skip_python2 1
Name: python-pook Name: python-pook
Version: 1.0.2 Version: 1.1.0
Release: 0 Release: 0
Summary: HTTP traffic mocking and expectations Summary: HTTP traffic mocking and expectations
License: MIT License: MIT
URL: https://github.com/h2non/pook URL: https://github.com/h2non/pook
Source: https://files.pythonhosted.org/packages/source/p/pook/pook-%{version}.tar.gz 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: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
@ -50,7 +51,7 @@ BuildRequires: %{python_module xmltodict >= 0.10.2}
HTTP traffic mocking and expectations. HTTP traffic mocking and expectations.
%prep %prep
%setup -q -n pook-%{version} %autosetup -p1 -n pook-%{version}
rm -f setup.cfg pytest.ini tox.ini rm -f setup.cfg pytest.ini tox.ini
# Assist unittest on Python 2 # Assist unittest on Python 2
@ -77,6 +78,7 @@ $python -m unittest tests.integration.engines.unittest_suite
%files %{python_files} %files %{python_files}
%doc README.rst %doc README.rst
%license LICENSE %license LICENSE
%{python_sitelib}/* %{python_sitelib}/pook
%{python_sitelib}/pook-%{version}*-info
%changelog %changelog