From 04608c6e7682ed881a6889239dec62d6ff3425e1 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Tue, 26 Apr 2022 14:16:34 -0500 Subject: [PATCH] Switch to pyproject-rpm-macros This makes EPEL 9 backporting easier as it removes some of the unnecessary dependencies (such as `mock`). Related to BZ 2063713. Signed-off-by: Major Hayden --- python-redis.spec | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/python-redis.spec b/python-redis.spec index 15099da..099ee8c 100644 --- a/python-redis.spec +++ b/python-redis.spec @@ -1,60 +1,67 @@ +# Enable tests by default. +%bcond_without tests + %global upstream_name redis Name: python-%{upstream_name} Version: 4.2.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python interface to the Redis key-value store License: MIT URL: https://github.com/redis/redis-py Source0: https://github.com/redis/redis-py/archive/v%{version}/redis-py-%{version}.tar.gz BuildArch: noarch + +BuildRequires: python3-devel + +%if %{with tests} BuildRequires: redis +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-asyncio) +%endif %global _description\ This is a Python interface to the Redis key-value store. %description %_description -%package -n python3-redis +%package -n python3-%{upstream_name} Summary: Python 3 interface to the Redis key-value store -%{?python_provide:%python_provide python3-redis} -BuildRequires: python3-devel -BuildRequires: python3-deprecated -BuildRequires: python3-setuptools -BuildRequires: python3-py -BuildRequires: python3-pytest -BuildRequires: python3-mock -BuildRequires: python3-pytest-asyncio -BuildRequires: python3-async-timeout - -%description -n python3-redis +%{?python_provide:%python_provide python3-%{upstream_name}} + +%description -n python3-%{upstream_name} This is a Python 3 interface to the Redis key-value store. %prep %setup -qn redis-py-%{version} -rm -frv %{upstream_name}.egg-info # This test passes locally but fails in koji... rm tests/test_commands.py* +%generate_buildrequires +%pyproject_buildrequires %build -%py3_build +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files %{upstream_name} +%if %{with tests} %check redis-server & %pytest -m 'not onlycluster and not redismod and not ssl' kill %1 +%endif -%files -n python3-redis -%doc CHANGES LICENSE README.md -%{python3_sitelib}/%{upstream_name} -%{python3_sitelib}/%{upstream_name}-%{version}-py%{python3_version}.egg-info +%files -n python3-%{upstream_name} -f %{pyproject_files} +%doc CHANGES README.md %changelog +* Tue Apr 26 2022 Major Hayden - 4.2.2-2 +- Switch to pyproject-rpm-macros for easier EPEL 9 backport. + * Mon Apr 04 2022 Frantisek Zatloukal - 4.2.2-1 - Update to 4.2.2