## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           python-hiredis
Version:        3.1.0
Release:        %autorelease
Summary:        Python wrapper for hiredis

License:        BSD-2-Clause
URL:            https://github.com/redis/hiredis-py
Source:         %{url}/archive/v%{version}/python-hiredis-%{version}.tar.gz
# Drop vendor sources for hiredis and use the system one.
# Upstream issues (reported by OpenSUSE package mainteners):
# - https://github.com/redis/hiredis-py/issues/158
# - https://github.com/redis/hiredis-py/pull/159
# - https://github.com/redis/hiredis-py/pull/161
Patch0:         use-system-hiredis.patch

BuildRequires: python3-devel
BuildRequires: hiredis-devel
BuildRequires: gcc
BuildRequires: python3dist(pytest)


Requires: hiredis


# Fill in the actual package description to submit package to Fedora
%global _description %{expand:
Python extension that wraps protocol parsing code in hiredis.
It primarily speeds up parsing of multi bulk replies.}

%description %_description

%package -n     python3-hiredis
Summary:        %{summary}

%description -n python3-hiredis %_description


%prep
%autosetup -p1 -n hiredis-py-%{version}
# Use system hiredis
rm -r vendor/hiredis

%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files hiredis


%check
%pyproject_check_import
%pytest --import-mode append


%files -n python3-hiredis -f %{pyproject_files}
%doc README.md


%changelog
## START: Generated by rpmautospec
* Thu Dec 05 2024 Matteo Centenaro <matteo.centenaro@aiven.io> - 3.1.0-1
- Bump to version 3.1.0 (rhbz#2330379)

* Mon Jul 22 2024 Matteo Centenaro <matteo.centenaro@aiven.io> - 3.0.0-1
- Update to 3.0.0

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 2.3.2-4
- Rebuilt for Python 3.13

* Thu Feb 08 2024 Matteo Centenaro <matteo.centenaro@aiven.io> - 2.3.2-3
- Remove wrongly added tarball

* Fri Feb 02 2024 Matteo Centenaro <matteo.centenaro@aiven.io> - 2.3.2-2
- Fix: add missing hiredis requires

* Thu Feb 01 2024 Matteo Centenaro <matteo.centenaro@aiven.io> - 2.3.2-1
- Initial import for python-hiredis
## END: Generated by rpmautospec