SPECS: add python-gevent
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
# SPDX-FileCopyrightText: (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS)
|
||||
# SPDX-FileCopyrightText: (C) 2026 openRuyi Project Contributors
|
||||
# SPDX-FileContributor: Jvle <keke.oerv@isrc.iscas.ac.cn>
|
||||
#
|
||||
# SPDX-License-Identifier: MulanPSL-2.0
|
||||
|
||||
%global srcname gevent
|
||||
|
||||
Name: python-%{srcname}
|
||||
Version: 25.9.1
|
||||
Release: %autorelease
|
||||
Summary: A coroutine-based Python networking library
|
||||
License: MIT
|
||||
URL: http://www.gevent.org/
|
||||
VCS: git:git@github.com:gevent/gevent.git
|
||||
#!RemoteAsset
|
||||
Source0: https://files.pythonhosted.org/packages/source/g/%{srcname}/%{srcname}-%{version}.tar.gz
|
||||
BuildSystem: pyproject
|
||||
|
||||
BuildOption(install): -l %{srcname}
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: c-ares-devel
|
||||
BuildRequires: pkgconfig(libev)
|
||||
BuildRequires: pkgconfig(libuv)
|
||||
BuildRequires: pkgconfig(python3)
|
||||
BuildRequires: python3dist(greenlet)
|
||||
BuildRequires: python3dist(zope-event)
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
Provides: python3-%{srcname}
|
||||
%python_provide python3-%{srcname}
|
||||
|
||||
%description
|
||||
gevent is a coroutine-based Python networking library that uses greenlet to
|
||||
provide a high-level synchronous API on top of libevent event loop.
|
||||
|
||||
Features include:
|
||||
|
||||
* convenient API around greenlets
|
||||
* familiar synchronization primitives (gevent.event, gevent.queue)
|
||||
* socket module that cooperates
|
||||
* WSGI server on top of libevent-http
|
||||
* DNS requests done through libevent-dns
|
||||
* monkey patching utility to get pure Python modules to cooperate
|
||||
|
||||
%prep -a
|
||||
# Remove bundled libraries
|
||||
rm -r deps
|
||||
# Upstream intentionally includes C extension sources in the built package,
|
||||
# because... reasons (PyPy I think?) however we do not want that. Sources will
|
||||
# go into debuginfo as normal.
|
||||
sed -i -e 's/include_package_data=True/include_package_data=False/' setup.py
|
||||
# No linters
|
||||
sed -i -e '/coverage/d' -e '/objgraph/d' setup.py
|
||||
# Force re-cythonizing the sources - missing with github tarballs
|
||||
rm -f $(grep -rl '/\* Generated by Cython')
|
||||
rm -f src/gevent/_generated_include/*
|
||||
# Test requires network, fails in mock/koji
|
||||
mv src/gevent/tests/test__resolver_dnspython.py{,.needsnetwork}
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -t
|
||||
|
||||
%build -p
|
||||
export GEVENTSETUP_EMBED=0
|
||||
|
||||
%install -p
|
||||
export GEVENTSETUP_EMBED=0
|
||||
|
||||
%install -a
|
||||
find %{buildroot} -name '.buildinfo' -delete
|
||||
# Correct the permissions.
|
||||
find %{buildroot} -name '*.so' -exec chmod 755 {} ';'
|
||||
|
||||
%check -a
|
||||
cd src/gevent/tests && GEVENT_FILE=thread %{python3} -mgevent.tests test__*subprocess*.py
|
||||
|
||||
%files -f %{pyproject_files}
|
||||
%license LICENSE
|
||||
%doc README.rst
|
||||
|
||||
%changelog
|
||||
%{?autochangelog}
|
||||
Reference in New Issue
Block a user