diff --git a/.files b/.files
index db5ba2f..f5ec56f 100644
Binary files a/.files and b/.files differ
diff --git a/.rev b/.rev
index 90ad79c..350ef56 100644
--- a/.rev
+++ b/.rev
@@ -7,4 +7,33 @@
just a nice-to-have
851908
+
+ 7f78cf891415acae496b8cb03dfc6ba5
+ 2.0.1
+
+ dimstar_suse
+ - Fix typo in Requires (closing curly bracket in
+ Requires: python-typing_extensions}).
+
+- Add 0002-skip-acl-tests-on-old-servers.patch to skip some tests
+ that fail on servers prior to Redis 6.2.0
+
+- Update to version 2.0.1
+ * Features
+ + Synchronized reading the responses from a connection (see #1106)
+ * Fixes
+ + Remove del from Redis (Fixes #1115) (see #1227)
+ + Fix socket.error raises (see #1129)
+ + Fix buffer is closed error when using PythonParser class (see #1213)
+- Changes from version 2.0.0
+ * Features
+ + Port redis-py's client implementation to aioredis. (see #891)
+ + Make hiredis an optional dependency. (see #917)
+- Remove obsolete patches
+ * aioredis-1.3.1-fix-tests-on-python38.patch
+ * aioredis-1.3.1-fix-tests-on-python38-part2.patch
+- Add 0001-fix-geopos-test.patch to fix floatin point comparison
+ in geopos test
+ 950057
+
diff --git a/0001-fix-geopos-test.patch b/0001-fix-geopos-test.patch
new file mode 100644
index 0000000..0480d9e
--- /dev/null
+++ b/0001-fix-geopos-test.patch
@@ -0,0 +1,42 @@
+From: Matthias Fehring
+Date: 2022-0119 13:40:00 +0100
+Subject: fix floating point comparison in test
+Upstream: no
+
+The returned floating point values are slightly different from
+the reference values. Upstreams mentions this and already uses adopted
+reference values, but different python versions still return slightly
+different values. This patch uses math.isclose instead of comparison
+operator.
+
+---
+ test_commands.py | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- a/tests/test_commands.py 2021-12-27 21:28:05.000000000 +0100
++++ b/tests/test_commands.py 2022-01-19 13:32:59.075905731 +0100
+@@ -5,6 +5,7 @@ import time
+ from string import ascii_letters
+
+ import pytest
++import math
+
+ import aioredis
+ from aioredis import exceptions
+@@ -2170,10 +2171,12 @@ class TestRedisCommands:
+
+ await r.geoadd("barcelona", *values)
+ # redis uses 52 bits precision, hereby small errors may be introduced.
+- assert await r.geopos("barcelona", "place1", "place2") == [
+- (2.19093829393386841, 41.43379028184083523),
+- (2.18737632036209106, 41.40634178640635099),
+- ]
++ positions = await r.geopos("barcelona", "place1", "place2")
++
++ assert math.isclose(positions[0][0], 2.19093829393386841, rel_tol=1e-5)
++ assert math.isclose(positions[0][1], 41.43379028184083523, rel_tol=1e-5)
++ assert math.isclose(positions[1][0], 2.18737632036209106, rel_tol=1e-5)
++ assert math.isclose(positions[1][1], 41.40634178640635099, rel_tol=1e-5)
+
+ @skip_if_server_version_lt("4.0.0")
+ async def test_geopos_no_value(self, r: aioredis.Redis):
diff --git a/0002-skip-acl-tests-on-old-servers.patch b/0002-skip-acl-tests-on-old-servers.patch
new file mode 100644
index 0000000..607af46
--- /dev/null
+++ b/0002-skip-acl-tests-on-old-servers.patch
@@ -0,0 +1,33 @@
+From: Matthias Fehring
+Date: 2022-01-25 19:36:00 +0100
+Subject: skip acl tests on old servers
+Upstream: no
+
+Redis server prior to version 6.2.0 fail executing some ACL specific tests.
+According to Redis changelog, some ACL support has been introduced with
+version 6.2-rc1.
+
+---
+ test_commands.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/tests/test_commands.py 2022-01-25 19:34:59.427241656 +0100
++++ b/tests/test_commands.py 2022-01-25 19:33:52.555242854 +0100
+@@ -104,7 +104,7 @@ class TestRedisCommands:
+ password = await r.acl_genpass()
+ assert isinstance(password, str)
+
+- @skip_if_server_version_lt(REDIS_6_VERSION)
++ @skip_if_server_version_lt("6.2.0")
+ async def test_acl_getuser_setuser(self, r: aioredis.Redis, request, event_loop):
+ username = "redis-py-user"
+
+@@ -219,7 +219,7 @@ class TestRedisCommands:
+ )
+ assert len((await r.acl_getuser(username))["passwords"]) == 1
+
+- @skip_if_server_version_lt(REDIS_6_VERSION)
++ @skip_if_server_version_lt("6.2.0")
+ async def test_acl_list(self, r: aioredis.Redis, request, event_loop):
+ username = "redis-py-user"
+
diff --git a/aioredis-1.3.1-fix-tests-on-python38-part2.patch b/aioredis-1.3.1-fix-tests-on-python38-part2.patch
deleted file mode 100644
index 600b4b9..0000000
--- a/aioredis-1.3.1-fix-tests-on-python38-part2.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-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
deleted file mode 100644
index c75023d..0000000
--- a/aioredis-1.3.1-fix-tests-on-python38.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-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
deleted file mode 120000
index c7e3c4b..0000000
--- a/aioredis-1.3.1.tar.gz
+++ /dev/null
@@ -1 +0,0 @@
-/ipfs/bafkreiav7cxtbmcey5y25ztypzpmeruuybebqtd3tzkmhnqmoufexezhhi
\ No newline at end of file
diff --git a/aioredis-2.0.1.tar.gz b/aioredis-2.0.1.tar.gz
new file mode 120000
index 0000000..6f7c06c
--- /dev/null
+++ b/aioredis-2.0.1.tar.gz
@@ -0,0 +1 @@
+/ipfs/bafkreihkuunk7gj7fvy7ks3qkj6eibbxxjstibmiv7vxq3gyprk4rhgzry
\ No newline at end of file
diff --git a/python-aioredis.changes b/python-aioredis.changes
index 5cb5a4b..e6365d2 100644
--- a/python-aioredis.changes
+++ b/python-aioredis.changes
@@ -1,4 +1,36 @@
-------------------------------------------------------------------
+Thu Jan 27 07:43:19 UTC 2022 - Dominique Leuenberger
+
+- Fix typo in Requires (closing curly bracket in
+ Requires: python-typing_extensions}).
+
+-------------------------------------------------------------------
+Tue Jan 25 18:49:02 UTC 2022 - Matthias Fehring
+
+- Add 0002-skip-acl-tests-on-old-servers.patch to skip some tests
+ that fail on servers prior to Redis 6.2.0
+
+-------------------------------------------------------------------
+Wed Jan 19 12:43:28 UTC 2022 - Matthias Fehring
+
+- Update to version 2.0.1
+ * Features
+ + Synchronized reading the responses from a connection (see #1106)
+ * Fixes
+ + Remove del from Redis (Fixes #1115) (see #1227)
+ + Fix socket.error raises (see #1129)
+ + Fix buffer is closed error when using PythonParser class (see #1213)
+- Changes from version 2.0.0
+ * Features
+ + Port redis-py's client implementation to aioredis. (see #891)
+ + Make hiredis an optional dependency. (see #917)
+- Remove obsolete patches
+ * aioredis-1.3.1-fix-tests-on-python38.patch
+ * aioredis-1.3.1-fix-tests-on-python38-part2.patch
+- Add 0001-fix-geopos-test.patch to fix floatin point comparison
+ in geopos test
+
+-------------------------------------------------------------------
Sat Nov 28 05:21:09 UTC 2020 - John Vandenberg
- Remove dependency on hires
diff --git a/python-aioredis.spec b/python-aioredis.spec
index 7c08ed0..4a2f492 100644
--- a/python-aioredis.spec
+++ b/python-aioredis.spec
@@ -1,7 +1,7 @@
#
# spec file for package python-aioredis
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2019 Matthias Fehring
#
# All modifications and additions to the file contributed by third parties
@@ -20,28 +20,38 @@
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-aioredis
-Version: 1.3.1
+Version: 2.0.1
Release: 0
-Summary: Python asyncio Redis support
+Summary: AsyncIO Python 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
+# PATCH-FIX-OPENSUSE 0001-fix-geopos-test.patch buschmann23@opensuse.org -- Fix floating point comparison in geopos test
+Patch0: 0001-fix-geopos-test.patch
+# PATCH-FIX-UPSTREAM 0002-skip-acl-tests-on-old-servers.patch buschmann23@opensuse.org -- Skip ACL tests on old server versions
+Patch1: 0002-skip-acl-tests-on-old-servers.patch
+BuildRequires: %{python_module async_timeout >= 4.0.2}
BuildRequires: %{python_module setuptools >= 38.6.0}
+BuildRequires: %{python_module typing_extensions}
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: %{python_module coverage >= 6.2}
+BuildRequires: %{python_module flake8 >= 4.0.1}
+BuildRequires: %{python_module hiredis >= 2.0.0}
+BuildRequires: %{python_module mock >= 4.0.3}
+BuildRequires: %{python_module pytest >= 6.2.5}
+BuildRequires: %{python_module pytest-asyncio >= 0.16.0}
+BuildRequires: %{python_module pytest-cov >= 3.0.0}
+BuildRequires: %{python_module pytest-sugar >= 0.9.4}
+BuildRequires: %{python_module pytest-xdist >= 2.4.0}
BuildRequires: redis
# /SECTION
+Requires: python-async_timeout
+Requires: python-typing_extensions
+Recommends: redis
+BuildArch: noarch
%python_subpackages
%description
@@ -49,13 +59,8 @@ The library is intended to provide simple and clear interface to Redis based on
%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
@@ -65,19 +70,17 @@ sed -Ei '/(platform.python_implementation|hiredis)/d' setup.py
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-export PATH=$PATH:%{_sbindir}
+# start the redis server
+%{_sbindir}/redis-server &
-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
-%pytest -k "not ($fail_pattern)"
-# Show known errors
-%pytest -k "$fail_pattern" ||:
+# kill the redis server
+kill %%1
%files %{python_files}
%license LICENSE
-%doc CHANGES.txt
+%doc CHANGELOG.md
%{python_sitelib}/aioredis-%{version}-*.egg-info/
%{python_sitelib}/aioredis/