Blob Blame History Raw
%global sname aiokafka
%global owner aio-libs

# crc32c does not support big-endian arch:
%bcond c_extensions %["%{_arch}" != "s390x"]

%{!?with_c_extensions:%global debug_package %{nil}}

Name:       python-%{sname}
Version:    0.10.0
Release:    %autorelease
Summary:    Asyncio client for Kafka
License:    ASL 2.0

BuildRequires:  python3-devel
BuildRequires:  gcc
BuildRequires:  python3dist(docker)
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(pytest-asyncio)
BuildRequires:  python3dist(pytest-mock)
BuildRequires:  snappy-devel
BuildRequires:  zlib-devel


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

%description -n python3-%{sname}

%autosetup -p1 -n %{sname}-%{version}

# According to pyproject.toml, Cython is too old on Fedora 38, however it builds fine
%if 0%{?fedora} == 38
sed -i 's/Cython >=.*"\]/Cython"\]/' pyproject.toml

%if %{without c_extensions}
sed -i "s/    ext_modules/#    ext_modules/"

%pyproject_buildrequires -x snappy,lz4,zstd,gssapi,all


%pyproject_save_files %{sname}

# The flag 'no:warnings' was added since the 'distutils' is now deprecated in Python 3.10 and 3.11, to be removed in Python 3.12
%{!?with_c_extensions:AIOKAFKA_NO_EXTENSIONS=1} %pytest --import-mode append -p no:warnings ${tests_dir}

%files -n python3-%{sname} -f %{pyproject_files}
%license LICENSE
%doc README.rst