Sync from SUSE:SLFO:Main python-fakeredis revision 5fdbc8f4e56e885bc40474ed47c9a45f

This commit is contained in:
Adrian Schröter 2024-12-13 11:24:40 +01:00
parent e1b764fbb4
commit c9fc4d5003
5 changed files with 120 additions and 9 deletions

BIN
fakeredis-2.19.0-gh.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
fakeredis-2.23.4-gh.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

29
fix-tests.patch Normal file
View File

@ -0,0 +1,29 @@
From b6c0140e17fb571906251e0fb300a52735427bf7 Mon Sep 17 00:00:00 2001
From: Daniel M <daniel.maruani@gmail.com>
Date: Fri, 27 Sep 2024 14:14:53 -0400
Subject: [PATCH] fix:tests for redis 5.1.0
---
test/test_asyncredis.py | 5 +--
test/test_mixins/test_set_commands.py | 50 +++++++++++++++++----------
2 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/test/test_asyncredis.py b/test/test_asyncredis.py
index 9f623d38..c98bb515 100644
--- a/test/test_asyncredis.py
+++ b/test/test_asyncredis.py
@@ -165,11 +165,12 @@ async def test_failed_script_error7(self, async_redis):
await async_redis.eval('return redis.call("ZCOUNT", KEYS[1])', 1, "foo")
+@fake_only
@testtools.run_test_if_redispy_ver("gte", "5.1")
async def test_repr_redis_51(async_redis: redis.asyncio.Redis):
assert re.fullmatch(
- r"<redis.asyncio.connection.ConnectionPool("
- r"<fakeredis.aioredis.FakeConnection(server=<fakeredis._server.FakeServer object at .*>,db=0)>)>",
+ r"<redis.asyncio.connection.ConnectionPool\("
+ r"<fakeredis.aioredis.FakeConnection\(server=<fakeredis._server.FakeServer object at .*>,db=0\)>\)>",
repr(async_redis.connection_pool),
)

View File

@ -1,3 +1,83 @@
-------------------------------------------------------------------
Tue Oct 8 16:14:14 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Add upstream fix-tests.patch
-------------------------------------------------------------------
Wed Jul 31 02:16:56 UTC 2024 - Martin Schreiner <martin.schreiner@suse.com>
- Update to 2.23.4.
- Changes from v2.23.4
* fix:move random seed to HeavyKeeper to avoid issues.
* Documented how to use fakeredis with FastAPI.
* Using black for linting python code.
- Changes from v2.23.3
* docs: Full code for FastAPI integration
* Fix ttl for empty stream
- Changes from v2.23.2
* Fix reading multiple streams with blocking
- Changes from v2.23.1
* Fix `XREAD` behavior when `COUNT` is not provided but `BLOCKING`
is provided
- Changes from v2.23.0
* Support for TDigest commands:
`TDIGEST.ADD`,`TDIGEST.BYRANK`,`TDIGEST.BYREVRANK`,`TDIGEST.CDF`,
`TDIGEST.CREATE`, `TDIGEST.INFO`, `TDIGEST.MAX`, `TDIGEST.MERGE`,
`TDIGEST.MIN`, `TDIGEST.QUANTILE`, `TDIGEST.RANK`,
`TDIGEST.RESET`, `TDIGEST.REVRANK`, `TDIGEST.TRIMMED_MEAN`.
* Import `Self` from typing vs. typing_extension
* Update dependencies
* Add redis-py 5.0.4 to tests
* Update lupa version constraint
- Changes from v2.22.0
* Support for setting LUA version from environment variable
`FAKEREDIS_LUA_VERSION`
* Support for loading LUA binary modules in fakeredis
* Fix the type hint for the version parameter in the async client
* Using LUA 5.1 like real redis
* fix: FakeRedisMixin.from_url() return type is really Self.
- Changes from v2.21.3
* Revert behavior of defaulting to share the same server data
structure between connections
* Fix type hint for version
- Changes from v2.21.2
* Connection params are defaulted to be the same between async and
sync connections
* `xinfo_stream` raises exception when stream does not exist
- Changes from v2.21.1
* Support for float timeout values
* Fix django cache documentation
- Remove leftover dependency on python-packaging (solves rpmlint
warnings, too).
- Add new test and runtime dependency on 'typing_extensions' >= 4.7.
- No longer remove test file 'test/test_redis_asyncio.py'.
-------------------------------------------------------------------
Sun Feb 4 10:08:59 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 2.21.0:
* Implement all TOP-K commands (`TOPK.INFO`, `TOPK.LIST`,
`TOPK.RESERVE`,
* `TOPK.ADD`, `TOPK.COUNT`, `TOPK.QUERY`, `TOPK.INCRBY`) #278
* Implement all cuckoo filter commands #276
* Implement all Count-Min Sketch commands #277
* Fix XREAD blocking bug #274 #275
* EXAT option does not work #279
-------------------------------------------------------------------
Mon Dec 18 09:28:02 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 2.20.1:
* Fix `XREAD` bug #256
* Testing for python 3.12
-------------------------------------------------------------------
Mon Dec 4 21:41:12 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 2.20.0:
* Implement `BITFIELD` command #247
* Implement `COMMAND`, `COMMAND INFO`, `COMMAND COUNT` #248
-------------------------------------------------------------------
Thu Oct 19 10:04:58 UTC 2023 - Matej Cepl <mcepl@cepl.eu>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-fakeredis
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,30 +18,33 @@
%{?sle15_python_module_pythons}
Name: python-fakeredis
Version: 2.19.0
Version: 2.23.4
Release: 0
Summary: Fake implementation of redis API for testing purposes
License: BSD-3-Clause AND MIT
URL: https://github.com/cunla/fakeredis-py
Source: https://github.com/cunla/fakeredis-py/archive/refs/tags/v%{version}.tar.gz#/fakeredis-%{version}-gh.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/cunla/fakeredis-py/commit/b6c0140e17fb571906251e0fb300a52735427bf7 fix:tests for redis 5.1.0
# there is a new version, but the update failed for me
Patch: fix-tests.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module poetry-core}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-packaging >= 23.1
Requires: python-redis >= 4
Requires: python-sortedcontainers >= 2.4.0
Requires: python-typing_extensions >= 4.7
Suggests: python-lupa >= 1.14
BuildArch: noarch
# SECTION test requirements
# technically requires hypothesis >= 6.56, but we don't have it yet
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module hypothesis >= 6.56}
BuildRequires: %{python_module pytest >= 7.1.2}
BuildRequires: %{python_module pytest-asyncio >= 0.19.0}
BuildRequires: %{python_module pytest-mock >= 3.7.0}
BuildRequires: %{python_module redis >= 4}
BuildRequires: %{python_module sortedcontainers >= 2.4.0}
BuildRequires: %{python_module typing_extensions >= 4.7}
# /SECTION
%python_subpackages
@ -60,7 +63,6 @@ Fake implementation of redis API for testing purposes.
%check
export LANG="en_US.UTF8"
rm -v test/test_redis_asyncio.py
%pytest -m "not slow"
%files %{python_files}