14
0
forked from pool/python-redis

11 Commits

Author SHA256 Message Date
227526a1e2 Accepting request 1245617 from devel:languages:python
- Add pytest-asyncio-045.patch to make tests compatible with latest
  python-pytest-asyncio
- Update to 5.2.1:
  * Fixed unsecured tempfile.mktemp() command usage (#3446)
  * Fixed bug with SLOWLOG GET response parsing on Redis Software (#3441)
  * Fixed issue with invoking _close() on closed event loop (#3438)
  * Migrate test infrastructure to new custom docker images (#3415)
  * Fixed flacky test with HEXPIREAT command (#3437)

OBS-URL: https://build.opensuse.org/request/show/1245617
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-redis?expand=0&rev=44
2025-02-14 18:19:23 +00:00
6a2af8ebb7 - Add pytest-asyncio-045.patch to make tests compatible with latest
python-pytest-asyncio

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=99
2025-02-13 11:52:23 +00:00
2c3fb9a318 - Update to 5.2.1:
* Fixed unsecured tempfile.mktemp() command usage (#3446)
  * Fixed bug with SLOWLOG GET response parsing on Redis Software (#3441)
  * Fixed issue with invoking _close() on closed event loop (#3438)
  * Migrate test infrastructure to new custom docker images (#3415)
  * Fixed flacky test with HEXPIREAT command (#3437)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=98
2025-02-13 11:00:13 +00:00
509395d6b0 Accepting request 1227113 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1227113
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-redis?expand=0&rev=43
2024-11-28 23:08:46 +00:00
307a5bd9d1 - Pin tests to pytest-asyncio < 0.24
- Only require async-timeout for older pythons

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=96
2024-11-28 11:37:49 +00:00
1b7e8b8a28 Accepting request 1225386 from devel:languages:python
- update to 5.2.0:
  * Extend AggregateRequest with scorer argument

OBS-URL: https://build.opensuse.org/request/show/1225386
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-redis?expand=0&rev=42
2024-11-21 14:13:30 +00:00
ac0cdf7a12 - update to 5.2.0:
* Extend AggregateRequest with scorer argument

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=94
2024-11-20 17:54:33 +00:00
d7a0465d3a Accepting request 1206271 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1206271
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-redis?expand=0&rev=41
2024-10-09 20:03:06 +00:00
140ec5d80b - Update to 5.1.1
https://github.com/redis/redis-py/releases/tag/v5.1.1
  https://github.com/redis/redis-py/releases/tag/v5.1.0
  https://github.com/redis/redis-py/releases/tag/v5.0.9
- Skip test_asyncio/test_commands.py, fails in OBS but passes locally
- Use --enable-debug-command and --enable-module-command for valkey 8.x.x

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=92
2024-10-08 09:01:51 +00:00
cbe88a520e Accepting request 1190532 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1190532
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-redis?expand=0&rev=40
2024-08-01 20:03:19 +00:00
270fc7d402 Accepting request 1190500 from home:darix:apps
- replace with pypi tarball again

- Fix filelist

- Update to 5.0.8
  Required update to support Redis 7.4.0
  https://github.com/redis/redis-py/releases/tag/v5.0.8
  https://github.com/redis/redis-py/releases/tag/v5.0.7
  https://github.com/redis/redis-py/releases/tag/v5.0.6
  https://github.com/redis/redis-py/releases/tag/v5.0.5
  https://github.com/redis/redis-py/releases/tag/v5.0.4
  https://github.com/redis/redis-py/releases/tag/v5.0.3
  https://github.com/redis/redis-py/releases/tag/v5.0.2
- drop Close-various-objects-created-during-asyncio-tests.patch
  included in update
- New BR numpy for the testsuite

OBS-URL: https://build.opensuse.org/request/show/1190500
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=90
2024-07-30 20:08:36 +00:00
9 changed files with 115 additions and 128 deletions

View File

@@ -1,4 +0,0 @@
<multibuild>
<package>test</package>
</multibuild>

74
pytest-asyncio-045.patch Normal file
View File

@@ -0,0 +1,74 @@
Index: python-redis/redis-5.2.1/tests/test_asyncio/test_scripting.py
===================================================================
--- python-redis.orig/redis-5.2.1/tests/test_asyncio/test_scripting.py
+++ python-redis/redis-5.2.1/tests/test_asyncio/test_scripting.py
@@ -28,14 +28,14 @@ class TestScripting:
yield redis
await redis.script_flush()
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
async def test_eval(self, r):
await r.flushdb()
await r.set("a", 2)
# 2 * 3 == 6
assert await r.eval(multiply_script, 1, "a", 3) == 6
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
@skip_if_server_version_lt("6.2.0")
async def test_script_flush(self, r):
await r.set("a", 2)
@@ -55,14 +55,14 @@ class TestScripting:
await r.script_load(multiply_script)
await r.script_flush("NOTREAL")
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
async def test_evalsha(self, r):
await r.set("a", 2)
sha = await r.script_load(multiply_script)
# 2 * 3 == 6
assert await r.evalsha(sha, 1, "a", 3) == 6
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
async def test_evalsha_script_not_loaded(self, r):
await r.set("a", 2)
sha = await r.script_load(multiply_script)
@@ -71,7 +71,7 @@ class TestScripting:
with pytest.raises(exceptions.NoScriptError):
await r.evalsha(sha, 1, "a", 3)
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
async def test_script_loading(self, r):
# get the sha, then clear the cache
sha = await r.script_load(multiply_script)
@@ -80,7 +80,7 @@ class TestScripting:
await r.script_load(multiply_script)
assert await r.script_exists(sha) == [True]
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
async def test_script_object(self, r):
await r.script_flush()
await r.set("a", 2)
@@ -97,7 +97,7 @@ class TestScripting:
# Test first evalsha block
assert await multiply(keys=["a"], args=[3]) == 6
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
async def test_script_object_in_pipeline(self, r):
await r.script_flush()
multiply = r.register_script(multiply_script)
@@ -127,7 +127,7 @@ class TestScripting:
assert await pipe.execute() == [True, b"2", 6]
assert await r.script_exists(multiply.sha) == [True]
- @pytest.mark.asyncio(forbid_global_loop=True)
+ @pytest.mark.asyncio()
async def test_eval_msgpack_pipeline_error_in_lua(self, r):
msgpack_hello = r.register_script(msgpack_hello_script)
assert msgpack_hello.sha

19
pytest.ini Normal file
View File

@@ -0,0 +1,19 @@
[pytest]
addopts = -s
markers =
redismod: run only the redis module tests
graph: run only the redisgraph tests
pipeline: pipeline tests
onlycluster: marks tests to be run only with cluster mode redis
onlynoncluster: marks tests to be run only with standalone redis
ssl: marker for only the ssl tests
asyncio: marker for async tests
replica: replica tests
experimental: run only experimental tests
asyncio_mode = auto
timeout = 30
filterwarnings =
always
ignore:RedisGraph support is deprecated as of Redis Stack 7.2:DeprecationWarning
# Ignore a coverage warning when COVERAGE_CORE=sysmon for Pythons < 3.12.
ignore:sys.monitoring isn't available:coverage.exceptions.CoverageWarning

View File

@@ -1,39 +1,3 @@
-------------------------------------------------------------------
Mon Jun 30 16:54:24 UTC 2025 - Илья Индиго <ilya@ilya.top>
- Added test_add_elem_no_quant.patch to fix test on 32 bit archs.
-------------------------------------------------------------------
Thu Jun 12 10:24:11 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
- Remove not needed pytest.ini source file.
-------------------------------------------------------------------
Tue Jun 10 16:44:41 UTC 2025 - Antonio Teixeira <antonio.teixeira@suse.com>
- Update to 6.2.0:
* https://github.com/redis/redis-py/releases/tag/v6.2.0
* https://github.com/redis/redis-py/releases/tag/v6.1.0
* https://github.com/redis/redis-py/releases/tag/v6.0.0
* https://github.com/redis/redis-py/releases/tag/v5.3.0
- Drop pytest-asyncio-045.patch
* Fixed upstream
- Add remove-mock.patch
* Use built-in unittest.mock
- Don't remove test_graph.py
* The test was dropped upstream
- Add new python-redis-entraid and pytest-mock dependencies for tests
- Add new hatchling build requirement
* Remove setuptools which is no longer needed
- Move test suite to separate flavor to avoid dependency cycle with
python-redis-entraid
* Add _multibuild
* Move some dependencies that were only needed for tests to the new
flavor
- Update skipped test list due to gh#python/cpython#70654
* Skip test_re_auth_pub_sub_in_resp3
* Skip test_do_not_re_auth_pub_sub_in_resp2
-------------------------------------------------------------------
Thu Feb 13 10:59:14 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
@@ -1463,3 +1427,4 @@ Fri Apr 15 12:43:07 UTC 2011 - saschpe@suse.de
Sun Mar 7 22:27:15 UTC 2010 - prusnak@suse.cz
- Created package

View File

@@ -16,45 +16,34 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%endif
%if "%{flavor}" == ""
%define psuffix %{nil}
%bcond_with test
%endif
%bcond_without testing
%{?sle15_python_module_pythons}
Name: python-redis%{psuffix}
Version: 6.2.0
Name: python-redis
Version: 5.2.1
Release: 0
Summary: Python client for Redis key-value store
License: MIT
URL: https://github.com/redis/redis-py
Source0: https://files.pythonhosted.org/packages/source/r/redis/redis-%{version}.tar.gz
Source1: https://github.com/redis/redis-py/raw/refs/tags/v%{version}/pytest.ini
Patch0: increase-test-timeout.patch
Patch1: remove-mock.patch
Patch2: test_add_elem_no_quant.patch
# PATCH-FIX-OPENSUSE pytest-asyncio-045.patch
Patch1: pytest-asyncio-045.patch
BuildRequires: %{python_module async-timeout >= 4.0.2 if %python-base < 3.11.3}
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module packaging}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: psmisc
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module redis = %{version}}
BuildRequires: %{python_module redis-entraid}
%if %{with testing}
BuildRequires: redis
%endif
Requires: (python-async-timeout >= 4.0.2 if python-base < 3.11.3)
@@ -68,34 +57,32 @@ The Python interface to the Redis key-value store.
%prep
%autosetup -N -n redis-%{version}
# pytest.ini for pytest markers but without coverage
sed /coverage/d %SOURCE1 > pytest.ini
%ifarch s390x
%patch -P 0 -p1
%endif
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 1 -p2
# These tests pass locally but fail in obs with different
# environment, like ALP build...
rm tests/test_commands.py*
rm tests/test_asyncio/test_commands.py
# The openSUSE redis json, bloom, ts
# are missing in the repos
# The openSUSE redis json, bloom, ts and
# graph are missing in the repos
rm tests/test_bloom.py
rm tests/test_graph.py
rm tests/test_json.py
rm tests/test_timeseries.py
%if %{without test}
%build
%pyproject_wheel
%endif
%if %{without test}
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%if %{with testing}
%check
# upstream's tox testsuite starts several servers in docker containers listening on different ports.
# We just start two of them locally
@@ -119,19 +106,15 @@ sleep 2
donttest="test_geopos or test_georadius"
# gh#redis/redis-py#2554
donttest="$donttest or test_xautoclaim"
# gh#python/cpython#70654 -- Fix only present in python313 so disable the tests
donttest+=" or test_re_auth_pub_sub_in_resp3 or test_do_not_re_auth_pub_sub_in_resp2"
# gh#redis/redis-py#2679
donttest+=" or test_acl_getuser_setuser or test_acl_log"
%pytest -m 'not (onlycluster or redismod or ssl or graph)' -k "not ($donttest)" --ignore tests/test_ssl.py --ignore tests/test_asyncio/test_cluster.py --redis-url=redis://localhost:6379/
%endif
%if %{without test}
%files %{python_files}
%license LICENSE
%doc README.md
%{python_sitelib}/redis/
%{python_sitelib}/redis-%{version}.dist-info
%endif
%changelog

BIN
redis-5.2.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

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

View File

@@ -1,26 +0,0 @@
Index: b/tests/test_asyncio/test_credentials.py
===================================================================
--- a/tests/test_asyncio/test_credentials.py
+++ b/tests/test_asyncio/test_credentials.py
@@ -8,7 +8,7 @@ from typing import Optional, Tuple, Unio
import pytest
import pytest_asyncio
import redis
-from mock.mock import Mock, call
+from unittest.mock import Mock, call
from redis import AuthenticationError, DataError, RedisError, ResponseError
from redis.asyncio import Connection, ConnectionPool, Redis
from redis.asyncio.retry import Retry
Index: b/tests/test_credentials.py
===================================================================
--- a/tests/test_credentials.py
+++ b/tests/test_credentials.py
@@ -7,7 +7,7 @@ from typing import Optional, Tuple, Unio
import pytest
import redis
-from mock.mock import Mock, call
+from unittest.mock import Mock, call
from redis import AuthenticationError, DataError, Redis, ResponseError
from redis.auth.err import RequestTokenErr
from redis.backoff import NoBackoff

View File

@@ -1,24 +0,0 @@
diff -Pdpru redis-py-6.2.0.orig/tests/test_asyncio/test_vsets.py redis-py-6.2.0/tests/test_asyncio/test_vsets.py
--- redis-py-6.2.0.orig/tests/test_asyncio/test_vsets.py 2025-05-27 19:21:45.000000000 +0300
+++ redis-py-6.2.0/tests/test_asyncio/test_vsets.py 2025-06-30 18:35:24.108629200 +0300
@@ -83,7 +83,7 @@ async def test_add_elem_no_quant(d_clien
assert resp == 1
emb = await d_client.vset().vemb("myset", "elem1")
- assert _validate_quantization(float_array, emb, tolerance=0.0)
+ assert _validate_quantization(float_array, emb, tolerance=0.00001)
@skip_if_server_version_lt("7.9.0")
diff -Pdpru redis-py-6.2.0.orig/tests/test_vsets.py redis-py-6.2.0/tests/test_vsets.py
--- redis-py-6.2.0.orig/tests/test_vsets.py 2025-05-27 19:21:45.000000000 +0300
+++ redis-py-6.2.0/tests/test_vsets.py 2025-06-30 18:35:03.140295444 +0300
@@ -87,7 +87,7 @@ def test_add_elem_no_quant(d_client):
assert resp == 1
emb = d_client.vset().vemb("myset", "elem1")
- assert _validate_quantization(float_array, emb, tolerance=0.0)
+ assert _validate_quantization(float_array, emb, tolerance=0.00001)
@skip_if_server_version_lt("7.9.0")