From ff1580ddd7f3040a04d1c68d14e51fd5cf41f0d9 Mon Sep 17 00:00:00 2001 From: mcalabkova <> Date: Dec 01 2020 13:23:53 +0000 Subject: Update python-aioredis to version 1.3.1 / rev 1 via SR 851908 https://build.opensuse.org/request/show/851908 by user mcalabkova + dimstar_suse just a nice-to-have --- diff --git a/.files b/.files new file mode 100644 index 0000000..db5ba2f Binary files /dev/null and b/.files differ diff --git a/.meta b/.meta new file mode 100644 index 0000000..b43eb3f --- /dev/null +++ b/.meta @@ -0,0 +1,5 @@ + + AsyncIO Python Redis Support + The library is intended to provide simple and clear interface to Redis based on asyncio. + + diff --git a/.rev b/.rev new file mode 100644 index 0000000..90ad79c --- /dev/null +++ b/.rev @@ -0,0 +1,10 @@ + + + dfd1081b1157227ce82472312ad2948c + 1.3.1 + + dimstar_suse + just a nice-to-have + 851908 + + diff --git a/aioredis-1.3.1-fix-tests-on-python38-part2.patch b/aioredis-1.3.1-fix-tests-on-python38-part2.patch new file mode 100644 index 0000000..600b4b9 --- /dev/null +++ b/aioredis-1.3.1-fix-tests-on-python38-part2.patch @@ -0,0 +1,93 @@ +From 528f14284df394686401e454230a7cf9a5e75ded Mon Sep 17 00:00:00 2001 +From: Chao Guo +Date: Mon, 30 Mar 2020 16:35:37 +0800 +Subject: [PATCH 1/4] fix NoneType object is not iterable when iterate over + self._waiters + +--- + aioredis/locks.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/aioredis/locks.py b/aioredis/locks.py +index 1715530b..15147c9b 100644 +--- a/aioredis/locks.py ++++ b/aioredis/locks.py +@@ -18,7 +18,8 @@ async def acquire(self): + This method blocks until the lock is unlocked, then sets it to + locked and returns True. + """ +- if not self._locked and all(w.cancelled() for w in self._waiters): ++ if (not self._locked and (self._waiters is None ++ or all(w.cancelled() for w in self._waiters))): + self._locked = True + return True + + +From 5c168a6abcbcaf51c93603e8c1ee085c8b8c0e9d Mon Sep 17 00:00:00 2001 +From: Chao Guo +Date: Fri, 8 May 2020 16:18:38 +0800 +Subject: [PATCH 2/4] avoid self._waiters of None type + +--- + aioredis/locks.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/aioredis/locks.py b/aioredis/locks.py +index 15147c9b..ddd434b0 100644 +--- a/aioredis/locks.py ++++ b/aioredis/locks.py +@@ -39,7 +39,7 @@ async def acquire(self): + + def _wake_up_first(self): + """Wake up the first waiter who isn't cancelled.""" +- for fut in self._waiters: ++ for fut in (self._waiters or []): + if not fut.done(): + fut.set_result(True) + break + +From 93c9b1d0283d29e277926731900ba2d100747b53 Mon Sep 17 00:00:00 2001 +From: Chao Guo +Date: Fri, 8 May 2020 16:35:50 +0800 +Subject: [PATCH 3/4] reformat code + +--- + aioredis/locks.py | 3 +- + docs/conf.py | 109 +++++++++++++++++++++++----------------------- + 2 files changed, 56 insertions(+), 56 deletions(-) + +diff --git a/aioredis/locks.py b/aioredis/locks.py +index ddd434b0..c6d61669 100644 +--- a/aioredis/locks.py ++++ b/aioredis/locks.py +@@ -19,7 +19,8 @@ async def acquire(self): + locked and returns True. + """ + if (not self._locked and (self._waiters is None +- or all(w.cancelled() for w in self._waiters))): ++ or all(w.cancelled() ++ for w in self._waiters))): + self._locked = True + return True + +From c65ce5e4d90065fa111bfa35db32cfd38524cc7e Mon Sep 17 00:00:00 2001 +From: Chao Guo +Date: Fri, 8 May 2020 17:33:09 +0800 +Subject: [PATCH 4/4] add jeffguorg into contributors + +--- + CONTRIBUTORS.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt +index ea3e2e37..0abc7234 100644 +--- a/CONTRIBUTORS.txt ++++ b/CONTRIBUTORS.txt +@@ -11,6 +11,7 @@ Andrew Svetlov + Anton Salii + Anton Verinov + Artem Mazur ++Chao Guo + + David Francos + Dima Kruk diff --git a/aioredis-1.3.1-fix-tests-on-python38.patch b/aioredis-1.3.1-fix-tests-on-python38.patch new file mode 100644 index 0000000..c75023d --- /dev/null +++ b/aioredis-1.3.1-fix-tests-on-python38.patch @@ -0,0 +1,60 @@ +From be5ae76ce2c43a1316e6e86365215a0e26be49b3 Mon Sep 17 00:00:00 2001 +From: Alberto Planas +Date: Tue, 24 Mar 2020 14:40:49 +0100 +Subject: [PATCH] Fix some timeout tests for Python 3.8 + +--- + tests/connection_test.py | 8 ++++++-- + tests/pool_test.py | 6 ++++-- + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/tests/connection_test.py b/tests/connection_test.py +index 40c69d66..40b3a682 100644 +--- a/tests/connection_test.py ++++ b/tests/connection_test.py +@@ -59,7 +59,9 @@ async def test_connect_inject_connection_cls_invalid( + + async def test_connect_tcp_timeout(request, create_connection, server): + with patch('aioredis.connection.open_connection') as open_conn_mock: +- open_conn_mock.side_effect = lambda *a, **kw: asyncio.sleep(0.2) ++ async def __side_effect(*a, **kw): ++ return await asyncio.sleep(0.2) ++ open_conn_mock.side_effect = __side_effect + with pytest.raises(asyncio.TimeoutError): + await create_connection(server.tcp_address, timeout=0.1) + +@@ -84,7 +86,9 @@ async def test_connect_unixsocket(create_connection, server): + reason="No unixsocket on Windows") + async def test_connect_unixsocket_timeout(create_connection, server): + with patch('aioredis.connection.open_unix_connection') as open_conn_mock: +- open_conn_mock.side_effect = lambda *a, **kw: asyncio.sleep(0.2) ++ async def __side_effect(*a, **kw): ++ return await asyncio.sleep(0.2) ++ open_conn_mock.side_effect = __side_effect + with pytest.raises(asyncio.TimeoutError): + await create_connection(server.unixsocket, db=0, timeout=0.1) + +diff --git a/tests/pool_test.py b/tests/pool_test.py +index b5693f5d..0d28a934 100644 +--- a/tests/pool_test.py ++++ b/tests/pool_test.py +@@ -15,7 +15,7 @@ + ) + from _testutils import redis_version + +-BPO_34638 = sys.version_info >= (3, 8) ++BPO_34638 = (3, 8) < sys.version_info < (3, 8, 2) + + + def _assert_defaults(pool): +@@ -59,7 +59,9 @@ async def test_maxsize(maxsize, create_pool, server): + async def test_create_connection_timeout(create_pool, server): + with patch('aioredis.connection.open_connection') as\ + open_conn_mock: +- open_conn_mock.side_effect = lambda *a, **kw: asyncio.sleep(0.2) ++ async def __side_effect(*a, **kw): ++ return await asyncio.sleep(0.2) ++ open_conn_mock.side_effect = __side_effect + with pytest.raises(asyncio.TimeoutError): + await create_pool( + server.tcp_address, diff --git a/aioredis-1.3.1.tar.gz b/aioredis-1.3.1.tar.gz new file mode 120000 index 0000000..c7e3c4b --- /dev/null +++ b/aioredis-1.3.1.tar.gz @@ -0,0 +1 @@ +/ipfs/bafkreiav7cxtbmcey5y25ztypzpmeruuybebqtd3tzkmhnqmoufexezhhi \ No newline at end of file diff --git a/python-aioredis.changes b/python-aioredis.changes new file mode 100644 index 0000000..5cb5a4b --- /dev/null +++ b/python-aioredis.changes @@ -0,0 +1,60 @@ +------------------------------------------------------------------- +Sat Nov 28 05:21:09 UTC 2020 - John Vandenberg + +- Remove dependency on hires +- Skip test failures against Tumbleweed redis +- Remove build dependencies used for development + +------------------------------------------------------------------- +Fri Jul 3 13:59:19 UTC 2020 - Matthias Fehring + +- Try to fix build on openSUSE Leap 15.2+ by adding new patch + aioredis-1.3.1-fix-tests-on-python38-part2.patch, but it does not + fix the issue. There seem to be also issues with redis 6. +- Fix wrong URL tag. + +------------------------------------------------------------------- +Wed May 6 16:56:50 UTC 2020 - Matthias Fehring + +- fix build on openSUSE Tumbleweed + + Added aioredis-1.3.1-fix-tests-on-python38.patch to fix some tests + failing on python 3.8+ + +------------------------------------------------------------------- +Fri Dec 6 17:23:17 UTC 2019 - Matthias Fehring + +- update to version 1.3.1 + + Fix transaction data decoding + + Fix duplicate calls to pool.wait_closed() upon create_pool() exception. + + Drop explicit loop requirement in API. + Deprecate loop argument. + Throw warning in Python 3.8+ if explicit loop is passed to methods. +- update to version 1.3.0 + + Added xdel and xtrim method which missed in commands/streams.py + and also added unit test code for them + + Add count argument to spop command + + Add support for zpopmax and zpopmin redis commands + + Add towncrier: change notes are now stored in CHANGES.txt + + Type hints for the library + + A few additions to the sorted set commands: + * the blocking pop commands: BZPOPMAX and BZPOPMIN + * the CH and INCR options of the ZADD command + + Added no_ack parameter to xread_group streams method in commands/streams.py + + Fix for sensitive logging + + Fix slow memory leak in wait_closed implementation + + Fix handling of instances were Redis returns null fields for a + stream message +- spec file changes + + require pytest instead of pytest3 for building + +------------------------------------------------------------------- +Tue Sep 17 20:16:45 UTC 2019 - Matthias Fehring + +- spec file changes: + + use python-pytest3 and python-pytest3-xdist as build requirements + as aioredis does not seem to support pytest > 4 + +------------------------------------------------------------------- +Tue Jul 2 17:03:02 UTC 2019 - Matthias Fehring + +- initial package version 1.2.0 diff --git a/python-aioredis.spec b/python-aioredis.spec new file mode 100644 index 0000000..7c08ed0 --- /dev/null +++ b/python-aioredis.spec @@ -0,0 +1,84 @@ +# +# spec file for package python-aioredis +# +# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2019 Matthias Fehring +# +# 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/ +# + + +%{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 +Name: python-aioredis +Version: 1.3.1 +Release: 0 +Summary: Python asyncio Redis support +License: MIT +Group: Development/Languages/Python +URL: https://github.com/aio-libs/aioredis +Source0: https://files.pythonhosted.org/packages/source/a/aioredis/aioredis-%{version}.tar.gz +# PATCH-FIX-UPSTREAM aioredis-1.3.1-fix-tests-on-python38.patch -- https://github.com/aio-libs/aioredis/pull/724 +Patch0: aioredis-1.3.1-fix-tests-on-python38.patch +# PATCH-FIX-UPSTREAM aioredis-1.3.1-fix-tests-on-python38-part2.patch -- https://github.com/aio-libs/aioredis/pull/727 +Patch1: aioredis-1.3.1-fix-tests-on-python38-part2.patch +BuildRequires: %{python_module setuptools >= 38.6.0} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-async_timeout +Recommends: redis +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module async_timeout} +BuildRequires: %{python_module pytest} +BuildRequires: redis +# /SECTION +%python_subpackages + +%description +The library is intended to provide simple and clear interface to Redis based on asyncio. + +%prep +%setup -q -n aioredis-%{version} +%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200 +%patch0 -p1 +%patch1 -p1 +%endif +rm setup.cfg +# Remove dependency on hiredis, which is a redis server embedded in a Python package +sed -Ei '/(platform.python_implementation|hiredis)/d' setup.py + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +export PATH=$PATH:%{_sbindir} + +fail_pattern='(connection_commands_test and test_auth) or test_master__auth or test_failover_command or test_command_info or test_client_list' +# test_hincrbyfloat fail on armv7l with float rounding error +fail_pattern+=' or test_hincrbyfloat or test_auto_failover' + +%pytest -k "not ($fail_pattern)" +# Show known errors +%pytest -k "$fail_pattern" ||: + +%files %{python_files} +%license LICENSE +%doc CHANGES.txt +%{python_sitelib}/aioredis-%{version}-*.egg-info/ +%{python_sitelib}/aioredis/ + +%changelog