04608c6
# Enable tests by default.
04608c6
%bcond_without tests
04608c6
Silas Sewell 2d72d2f
%global upstream_name redis
Silas Sewell 2d72d2f
Silas Sewell 2d72d2f
Name:           python-%{upstream_name}
4f4d745
Version:        5.0.3
5d34c11
Release:        %autorelease
a1f5282
Summary:        Python interface to the Redis key-value store
Silas Sewell 2d72d2f
License:        MIT
7421136
URL:            https://github.com/redis/redis-py
7421136
Source0:        https://github.com/redis/redis-py/archive/v%{version}/redis-py-%{version}.tar.gz
Silas Sewell 2d72d2f
BuildArch:      noarch
04608c6
04608c6
BuildRequires:  python3-devel
04608c6
04608c6
%if %{with tests}
Luke Macken dcabdad
BuildRequires:  redis
04608c6
BuildRequires:  python3dist(pytest)
04608c6
BuildRequires:  python3dist(pytest-asyncio)
9ca4a20
BuildRequires:  python3dist(async-timeout)
9ca4a20
BuildRequires:  python3dist(pytest-timeout)
04608c6
%endif
Silas Sewell 2d72d2f
fb2444a
%global _description\
a1f5282
This is a Python interface to the Redis key-value store.
2647cc3
fb2444a
%description %_description
fb2444a
04608c6
%package -n     python3-%{upstream_name}
4f6dffa
Summary:        Python 3 interface to the Redis key-value store
04608c6
%{?python_provide:%python_provide python3-%{upstream_name}}
04608c6
04608c6
%description -n python3-%{upstream_name}
2647cc3
This is a Python 3 interface to the Redis key-value store.
Luke Macken 9394419
Silas Sewell 2d72d2f
%prep
9ca4a20
%autosetup -n redis-py-%{version} -p1
Silas Sewell 2d72d2f
5409929
# This test passes locally but fails in koji...
5409929
rm tests/test_commands.py*
9ca4a20
rm tests/test_asyncio/test_commands.py
9ca4a20
9ca4a20
# Times out
9ca4a20
rm tests/test_asyncio/test_connect.py
9ca4a20
rm tests/test_asyncio/test_cwe_404.py
9ca4a20
9ca4a20
# The Fedora redis json and bloom packages are out of date, ts and graph are missing in the repos
9ca4a20
rm tests/test_bloom.py
9ca4a20
rm tests/test_graph.py
9ca4a20
rm tests/test_json.py
9ca4a20
rm tests/test_timeseries.py
4f4d745
rm tests/test_asyncio/test_bloom.py
4f4d745
rm tests/test_asyncio/test_graph.py
4f4d745
rm tests/test_asyncio/test_json.py
4f4d745
rm tests/test_asyncio/test_timeseries.py
5409929
04608c6
%generate_buildrequires
04608c6
%pyproject_buildrequires
Luke Macken 9394419
Silas Sewell 2d72d2f
%build
04608c6
%pyproject_wheel
Silas Sewell 2d72d2f
Silas Sewell 2d72d2f
%install
04608c6
%pyproject_install
04608c6
%pyproject_save_files %{upstream_name}
Silas Sewell 2d72d2f
04608c6
%if %{with tests}
Luke Macken cc38e70
%check
11a5982
%if 0%{?fedora} >= 37 || 0%{?rhel} > 9
11a5982
# redis 7+
a4d067f
redis-server --enable-debug-command yes &
a4d067f
%else
Luke Macken dcabdad
redis-server &
a4d067f
%endif
9ca4a20
%pytest -m 'not onlycluster and not redismod and not ssl'
Luke Macken dcabdad
kill %1
04608c6
%endif
Luke Macken cc38e70
04608c6
%files -n python3-%{upstream_name} -f %{pyproject_files}
04608c6
%doc CHANGES README.md
Luke Macken 9394419
Silas Sewell 2d72d2f
%changelog
5d34c11
%autochangelog