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 <major@mhtx.net>
epel9
Major Hayden 3 years ago
parent 7421136c55
commit 04608c6e76
No known key found for this signature in database
GPG Key ID: 737051E0C1011FB1

@ -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 <major@mhtx.net> - 4.2.2-2
- Switch to pyproject-rpm-macros for easier EPEL 9 backport.
* Mon Apr 04 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 4.2.2-1
- Update to 4.2.2

Loading…
Cancel
Save