2011-05-11 00:12:49 +00:00
#
# spec file for package python-redis
#
2023-01-18 13:10:50 +00:00
# Copyright (c) 2023 SUSE LLC
2011-05-11 00:12:49 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2011-12-12 09:06:34 +00:00
2019-03-26 09:41:16 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2011-05-11 00:12:49 +00:00
#
2012-09-05 07:51:37 +00:00
2023-05-08 08:19:35 +00:00
%{?sle15_python_module_pythons}
2011-09-23 12:14:33 +00:00
Name : python-redis
2023-07-18 15:32:54 +00:00
Version : 5.0.0rc2
2011-05-11 00:12:49 +00:00
Release : 0
2010-03-07 22:28:01 +00:00
Summary : Python client for Redis key-value store
License : MIT
2022-06-13 06:36:30 +00:00
URL : https://github.com/redis/redis-py
Source0 : https://files.pythonhosted.org/packages/source/r/redis/redis-%{version} .tar.gz
2023-07-18 15:32:54 +00:00
Source1 : https://github.com/redis/redis-py/raw/v%{version} /pytest.ini
2022-06-13 06:36:30 +00:00
BuildRequires : %{python_module async-timeout >= 4.0.2}
2023-04-18 03:13:49 +00:00
BuildRequires : %{python_module base >= 3.7}
BuildRequires : %{python_module packaging}
2022-06-13 06:36:30 +00:00
BuildRequires : %{python_module pytest-asyncio}
BuildRequires : %{python_module pytest-timeout}
BuildRequires : %{python_module pytest}
2019-04-01 09:04:18 +00:00
BuildRequires : %{python_module setuptools}
2017-06-29 15:29:54 +00:00
BuildRequires : fdupes
2018-08-28 14:25:43 +00:00
BuildRequires : psmisc
2017-06-29 15:29:54 +00:00
BuildRequires : python-rpm-macros
2018-08-28 14:25:43 +00:00
BuildRequires : redis
2022-06-13 06:36:30 +00:00
Requires : python-async-timeout >= 4.0.2
2018-08-28 14:25:43 +00:00
Requires : redis
2022-06-13 06:36:30 +00:00
Recommends: python-hiredis >= 1.0.0
2010-03-07 22:28:01 +00:00
BuildArch : noarch
2017-06-29 15:29:54 +00:00
%python_subpackages
2010-03-07 22:28:01 +00:00
%description
2013-08-05 09:30:25 +00:00
The Python interface to the Redis key-value store.
2010-03-07 22:28:01 +00:00
%prep
2021-07-16 09:17:26 +00:00
%autosetup -p1 -n redis-%{version}
2023-07-18 15:32:54 +00:00
# pytest.ini for pytest markers
2022-06-13 06:36:30 +00:00
cp %{SOURCE1} .
2010-03-07 22:28:01 +00:00
%build
2017-06-29 15:29:54 +00:00
%python_build
2010-03-07 22:28:01 +00:00
%install
2017-06-29 15:29:54 +00:00
%python_install
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2010-03-07 22:28:01 +00:00
2018-08-28 14:25:43 +00:00
%check
2022-06-13 06:36:30 +00:00
# upstream's tox testsuite starts several servers in docker containers listening on different ports.
# We just start two of them locally
# master
# https://github.com/redis/redis/pull/9920
%{_sbindir} /redis-server --version | grep ' v=7\.' && redis7args=" - - e n a b l e - d e b u g - c o m m a n d y e s - - e n a b l e - m o d u l e - c o m m a n d y e s "
%{_sbindir} /redis-server --port 6379 --save " " $redis7args &
victims=" $ ! "
trap " k i l l $ v i c t i m s | | t r u e " EXIT
sleep 2
# replica
%{_sbindir} /redis-server --port 6380 --save " " --replicaof localhost 6379 &
victims=" $ v i c t i m s $ ! "
trap " k i l l $ v i c t i m s | | t r u e " EXIT
sleep 2
# onlycluster: skip tests which require a full cluster
# redismod: Not available (https://github.com/RedisLabsModules/redismod)
# ssl: no stunnel with certs from docker container, fails at test collection
#
if [ $(getconf LONG_BIT) -ne 64 ]; then
# reference precision issues on 32-bit
donttest=" o r t e s t _ g e o p o s "
fi
2023-04-18 03:13:49 +00:00
%pytest -m 'not (onlycluster or redismod)' -k " n o t ( d u m m y p r e f i x $ d o n t t e s t ) " --ignore tests/test_ssl.py --ignore tests/test_asyncio/test_cluster.py --redis-url=redis://localhost:6379/
2018-08-28 14:25:43 +00:00
%files %{python_files}
%license LICENSE
2022-06-13 06:36:30 +00:00
%doc README.md
2019-11-29 09:45:14 +00:00
%{python_sitelib} /redis/
2022-06-13 06:36:30 +00:00
%{python_sitelib} /redis-%{version} *-info
2011-05-11 00:12:49 +00:00
%changelog