python-zmq/python-zmq.spec

115 lines
3.3 KiB
RPMSpec
Raw Permalink Normal View History

%global common_description %{expand:
The 0MQ lightweight messaging kernel is a library which extends the
standard socket interfaces with features traditionally provided by
specialized messaging middle-ware products. 0MQ sockets provide an
abstraction of asynchronous message queues, multiple messaging
patterns, message filtering (subscriptions), seamless access to
multiple transport protocols and more.}
2010-08-16 11:10:46 +00:00
2022-08-03 12:53:00 +00:00
Name: python-zmq
2023-10-22 22:53:44 +00:00
Version: 25.1.1
Release: %autorelease
2010-08-16 11:10:46 +00:00
Summary: Software library for fast, message-based applications
2023-10-22 22:53:44 +00:00
License: MPLv2.0 and ASL 2.0 and BSD
URL: https://zeromq.org/languages/python/
2022-08-03 12:53:00 +00:00
Source0: %{pypi_source pyzmq}
2024-03-11 09:27:23 +00:00
# Python 3.13 compatibility
Patch: https://github.com/zeromq/pyzmq/pull/1961.patch
BuildRequires: gcc
2014-08-27 21:19:09 +00:00
2023-10-22 23:21:23 +00:00
BuildRequires: pkgconfig(libzmq)
2010-08-16 11:10:46 +00:00
BuildRequires: python%{python3_pkgversion}-devel
2016-07-12 17:28:13 +00:00
BuildRequires: python%{python3_pkgversion}-pytest
2023-06-24 18:19:02 +00:00
BuildRequires: python%{python3_pkgversion}-pytest-asyncio
2016-07-12 17:28:13 +00:00
BuildRequires: python%{python3_pkgversion}-tornado
2022-08-03 12:45:53 +00:00
BuildRequires: python%{python3_pkgversion}-numpy
2010-08-16 11:10:46 +00:00
# The gevent tests are automatically skipped when gevent is not installed.
# When bootstrapping new Python versions, gevent is often not available until very late.
# This bcond allows to ship zmq without gevent when needed.
%bcond gevent 1
%if %{with gevent}
BuildRequires: python%{python3_pkgversion}-gevent
%endif
%description %{common_description}
2010-08-16 11:10:46 +00:00
2022-08-03 12:53:00 +00:00
%package -n python%{python3_pkgversion}-zmq
Summary: %{summary}
License: MPL-2.0
2022-08-03 12:53:00 +00:00
%py_provides python%{python3_pkgversion}-pyzmq
2022-08-03 12:53:00 +00:00
%description -n python%{python3_pkgversion}-zmq %{common_description}
2010-08-16 11:10:46 +00:00
This package contains the python bindings.
2022-08-03 12:53:00 +00:00
%package -n python%{python3_pkgversion}-zmq-tests
Summary: %{summary}, testsuite
License: MPL-2.0
Requires: python%{python3_pkgversion}-zmq = %{version}-%{release}
2022-08-03 12:53:00 +00:00
%py_provides python%{python3_pkgversion}-pyzmq-tests
2022-08-03 12:53:00 +00:00
%description -n python%{python3_pkgversion}-zmq-tests %{common_description}
This package contains the testsuite for the python bindings.
2010-08-16 11:10:46 +00:00
%prep
2024-03-11 09:27:23 +00:00
%autosetup -p1 -n pyzmq-%{version}
2023-06-24 18:19:02 +00:00
# Upstream is testing with cython 3 on 3.12
sed -i -e '/cython>=3/d' pyproject.toml test-requirements.txt
sed -i -e '/min_cython_version/s/"3.*"/"0.29"/' setup.py
2014-08-27 21:19:09 +00:00
# remove bundled libraries
rm -rf bundled
# remove the Cython .c files in order to regenerate them:
2019-05-14 18:10:49 +00:00
find zmq -name "*.c" -delete
2010-08-16 11:10:46 +00:00
# remove shebangs
grep -lr "^#\!/usr/bin/env python" | xargs sed -i "1d"
2010-08-16 11:10:46 +00:00
# remove excecutable bits
find . -type f -executable | xargs chmod -x
%generate_buildrequires
%pyproject_buildrequires
2010-08-16 11:10:46 +00:00
%build
%pyproject_wheel
2010-08-16 11:10:46 +00:00
%install
%pyproject_install
%pyproject_save_files zmq
2010-08-16 11:10:46 +00:00
%check
2022-08-03 12:45:53 +00:00
# to avoid partially initialized zmq module from cwd
2024-02-18 04:24:07 +00:00
# test_draft seems to get incorrectly run - https://github.com/zeromq/pyzmq/issues/1853
2022-08-03 12:45:53 +00:00
cd %{_topdir}
%pytest --pyargs zmq -v --asyncio-mode auto \
%ifarch ppc64le
2024-02-18 04:24:07 +00:00
-k "not (test_draft or test_green_device or (Green and (test_raw or test_timeout or test_poll)))" # this crashes on Python 3.12, TODO investigate
%else
-k "not test_draft"
%endif
2010-08-16 11:10:46 +00:00
2022-08-03 12:53:00 +00:00
%files -n python%{python3_pkgversion}-zmq -f %{pyproject_files}
2016-07-12 17:28:13 +00:00
%doc README.md
2022-08-03 12:53:00 +00:00
%exclude %{python3_sitearch}/zmq/tests
2022-08-03 12:53:00 +00:00
%files -n python%{python3_pkgversion}-zmq-tests
%{python3_sitearch}/zmq/tests
2010-08-16 11:10:46 +00:00
%changelog
2023-10-22 22:53:44 +00:00
%autochangelog