forked from pool/python-redis
Tests depend on https://build.opensuse.org/request/show/1284860
- 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 and wheel which is 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 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=101
This commit is contained in:
@@ -16,11 +16,20 @@
|
||||
#
|
||||
|
||||
|
||||
%bcond_without testing
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "test"
|
||||
%define psuffix -test
|
||||
%bcond_without test
|
||||
%endif
|
||||
|
||||
%if "%{flavor}" == ""
|
||||
%define psuffix %{nil}
|
||||
%bcond_with test
|
||||
%endif
|
||||
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-redis
|
||||
Version: 5.2.1
|
||||
Name: python-redis%{psuffix}
|
||||
Version: 6.2.0
|
||||
Release: 0
|
||||
Summary: Python client for Redis key-value store
|
||||
License: MIT
|
||||
@@ -28,22 +37,24 @@ 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
|
||||
# PATCH-FIX-OPENSUSE pytest-asyncio-045.patch
|
||||
Patch1: pytest-asyncio-045.patch
|
||||
Patch1: remove-mock.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 testing}
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module pytest-asyncio}
|
||||
BuildRequires: %{python_module pytest-mock}
|
||||
BuildRequires: %{python_module pytest-timeout}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module redis = %{version}}
|
||||
BuildRequires: %{python_module redis-entraid}
|
||||
BuildRequires: redis
|
||||
%endif
|
||||
Requires: (python-async-timeout >= 4.0.2 if python-base < 3.11.3)
|
||||
@@ -62,27 +73,30 @@ sed /coverage/d %SOURCE1 > pytest.ini
|
||||
%ifarch s390x
|
||||
%patch -P 0 -p1
|
||||
%endif
|
||||
%patch -P 1 -p2
|
||||
%patch -P 1 -p1
|
||||
|
||||
# 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 and
|
||||
# graph are missing in the repos
|
||||
# The openSUSE redis json, bloom, ts
|
||||
# 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 testing}
|
||||
%if %{with test}
|
||||
%check
|
||||
# upstream's tox testsuite starts several servers in docker containers listening on different ports.
|
||||
# We just start two of them locally
|
||||
@@ -106,15 +120,19 @@ 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
|
||||
|
Reference in New Issue
Block a user