forked from pool/python-gevent
- Update to 25.4.2: [bsc#1241067, bsc#1241037]
* Make gevent's queue classes subscriptable to match the standard
library. See issue #2102.
* Make the c-ares resolver build on Windows.
* The gevent testsuite runs a copy of the test_ssl from cpython but
the follwoing change has not been ported yet:
- gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError
in ConnectionHandler [gh#python/cpython/pull/126503]
- Rebase gevent-openssl35-test-fix.patch
- Upstream PR: [gh#gevent/gevent/pull/2103]
- Update to 25.4.1
* Remove some legacy code that supported Python 2 for compatibility
with the upcoming releases of Cython 3.1.
* Add a new environment variable and configuration setting to control
whether blocking reports are printed by the monitor thread.
* Add initial support for Python 3.14a7.
* Fix using gevent’s BackdoorServer with Unix sockets.
* Do not use pywsgi in a security-conscious environment. Fix one
security issue related to HTTP 100 Continue handling. See issue #2075.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gevent?expand=0&rev=119
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
||||
BIN
gevent-24.10.3.tar.gz
LFS
Normal file
BIN
gevent-24.10.3.tar.gz
LFS
Normal file
Binary file not shown.
3
gevent-24.2.1.tar.gz
Normal file
3
gevent-24.2.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:33d71611b05a9198c24ff2209b77cb0988a8031c5fa419e7d699c81094ca4e74
|
||||
size 4322696
|
||||
BIN
gevent-25.4.2.tar.gz
LFS
Normal file
BIN
gevent-25.4.2.tar.gz
LFS
Normal file
Binary file not shown.
185
gevent-openssl35-test-fix.patch
Normal file
185
gevent-openssl35-test-fix.patch
Normal file
@@ -0,0 +1,185 @@
|
||||
Index: gevent-25.4.2/src/greentest/3.11/test_ssl.py
|
||||
===================================================================
|
||||
--- gevent-25.4.2.orig/src/greentest/3.11/test_ssl.py
|
||||
+++ gevent-25.4.2/src/greentest/3.11/test_ssl.py
|
||||
@@ -2492,7 +2492,6 @@ class ThreadedEchoServer(threading.Threa
|
||||
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
|
||||
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
|
||||
self.running = False
|
||||
- self.server.stop()
|
||||
self.close()
|
||||
return False
|
||||
else:
|
||||
@@ -2627,10 +2626,6 @@ class ThreadedEchoServer(threading.Threa
|
||||
self.close()
|
||||
self.running = False
|
||||
|
||||
- # normally, we'd just stop here, but for the test
|
||||
- # harness, we want to stop the server
|
||||
- self.server.stop()
|
||||
-
|
||||
def __init__(self, certificate=None, ssl_version=None,
|
||||
certreqs=None, cacerts=None,
|
||||
chatty=True, connectionchatty=False, starttls_server=False,
|
||||
@@ -2664,21 +2659,33 @@ class ThreadedEchoServer(threading.Threa
|
||||
self.conn_errors = []
|
||||
threading.Thread.__init__(self)
|
||||
self.daemon = True
|
||||
+ self._in_context = False
|
||||
|
||||
def __enter__(self):
|
||||
+ if self._in_context:
|
||||
+ raise ValueError('Re-entering ThreadedEchoServer context')
|
||||
+ self._in_context = True
|
||||
self.start(threading.Event())
|
||||
self.flag.wait()
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
+ assert self._in_context
|
||||
+ self._in_context = False
|
||||
self.stop()
|
||||
self.join()
|
||||
|
||||
def start(self, flag=None):
|
||||
+ if not self._in_context:
|
||||
+ raise ValueError(
|
||||
+ 'ThreadedEchoServer must be used as a context manager')
|
||||
self.flag = flag
|
||||
threading.Thread.start(self)
|
||||
|
||||
def run(self):
|
||||
+ if not self._in_context:
|
||||
+ raise ValueError(
|
||||
+ 'ThreadedEchoServer must be used as a context manager')
|
||||
self.sock.settimeout(1.0)
|
||||
self.sock.listen(5)
|
||||
self.active = True
|
||||
Index: gevent-25.4.2/src/greentest/3.10/test_ssl.py
|
||||
===================================================================
|
||||
--- gevent-25.4.2.orig/src/greentest/3.10/test_ssl.py
|
||||
+++ gevent-25.4.2/src/greentest/3.10/test_ssl.py
|
||||
@@ -2485,7 +2485,6 @@ class ThreadedEchoServer(threading.Threa
|
||||
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
|
||||
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
|
||||
self.running = False
|
||||
- self.server.stop()
|
||||
self.close()
|
||||
return False
|
||||
else:
|
||||
@@ -2620,9 +2619,6 @@ class ThreadedEchoServer(threading.Threa
|
||||
self.close()
|
||||
self.running = False
|
||||
|
||||
- # normally, we'd just stop here, but for the test
|
||||
- # harness, we want to stop the server
|
||||
- self.server.stop()
|
||||
|
||||
def __init__(self, certificate=None, ssl_version=None,
|
||||
certreqs=None, cacerts=None,
|
||||
@@ -2657,21 +2653,33 @@ class ThreadedEchoServer(threading.Threa
|
||||
self.conn_errors = []
|
||||
threading.Thread.__init__(self)
|
||||
self.daemon = True
|
||||
+ self._in_context = False
|
||||
|
||||
def __enter__(self):
|
||||
+ if self._in_context:
|
||||
+ raise ValueError('Re-entering ThreadedEchoServer context')
|
||||
+ self._in_context = True
|
||||
self.start(threading.Event())
|
||||
self.flag.wait()
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
+ assert self._in_context
|
||||
+ self._in_context = False
|
||||
self.stop()
|
||||
self.join()
|
||||
|
||||
def start(self, flag=None):
|
||||
+ if not self._in_context:
|
||||
+ raise ValueError(
|
||||
+ 'ThreadedEchoServer must be used as a context manager')
|
||||
self.flag = flag
|
||||
threading.Thread.start(self)
|
||||
|
||||
def run(self):
|
||||
+ if not self._in_context:
|
||||
+ raise ValueError(
|
||||
+ 'ThreadedEchoServer must be used as a context manager')
|
||||
self.sock.settimeout(1.0)
|
||||
self.sock.listen(5)
|
||||
self.active = True
|
||||
Index: gevent-25.4.2/src/greentest/3.12/test_ssl.py
|
||||
===================================================================
|
||||
--- gevent-25.4.2.orig/src/greentest/3.12/test_ssl.py
|
||||
+++ gevent-25.4.2/src/greentest/3.12/test_ssl.py
|
||||
@@ -2300,7 +2300,6 @@ class ThreadedEchoServer(threading.Threa
|
||||
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
|
||||
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
|
||||
self.running = False
|
||||
- self.server.stop()
|
||||
self.close()
|
||||
return False
|
||||
else:
|
||||
@@ -2435,10 +2434,6 @@ class ThreadedEchoServer(threading.Threa
|
||||
self.close()
|
||||
self.running = False
|
||||
|
||||
- # normally, we'd just stop here, but for the test
|
||||
- # harness, we want to stop the server
|
||||
- self.server.stop()
|
||||
-
|
||||
def __init__(self, certificate=None, ssl_version=None,
|
||||
certreqs=None, cacerts=None,
|
||||
chatty=True, connectionchatty=False, starttls_server=False,
|
||||
@@ -2472,21 +2467,33 @@ class ThreadedEchoServer(threading.Threa
|
||||
self.conn_errors = []
|
||||
threading.Thread.__init__(self)
|
||||
self.daemon = True
|
||||
+ self._in_context = False
|
||||
|
||||
def __enter__(self):
|
||||
+ if self._in_context:
|
||||
+ raise ValueError('Re-entering ThreadedEchoServer context')
|
||||
+ self._in_context = True
|
||||
self.start(threading.Event())
|
||||
self.flag.wait()
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
+ assert self._in_context
|
||||
+ self._in_context = False
|
||||
self.stop()
|
||||
self.join()
|
||||
|
||||
def start(self, flag=None):
|
||||
+ if not self._in_context:
|
||||
+ raise ValueError(
|
||||
+ 'ThreadedEchoServer must be used as a context manager')
|
||||
self.flag = flag
|
||||
threading.Thread.start(self)
|
||||
|
||||
def run(self):
|
||||
+ if not self._in_context:
|
||||
+ raise ValueError(
|
||||
+ 'ThreadedEchoServer must be used as a context manager')
|
||||
self.sock.settimeout(1.0)
|
||||
self.sock.listen(5)
|
||||
self.active = True
|
||||
Index: gevent-25.4.2/src/greentest/3.9/test_ssl.py
|
||||
===================================================================
|
||||
--- gevent-25.4.2.orig/src/greentest/3.9/test_ssl.py
|
||||
+++ gevent-25.4.2/src/greentest/3.9/test_ssl.py
|
||||
@@ -2559,10 +2559,6 @@ class ThreadedEchoServer(threading.Threa
|
||||
self.close()
|
||||
self.running = False
|
||||
|
||||
- # normally, we'd just stop here, but for the test
|
||||
- # harness, we want to stop the server
|
||||
- self.server.stop()
|
||||
-
|
||||
def __init__(self, certificate=None, ssl_version=None,
|
||||
certreqs=None, cacerts=None,
|
||||
chatty=True, connectionchatty=False, starttls_server=False,
|
||||
15
gevent-opensuse-nocolor-tests.patch
Normal file
15
gevent-opensuse-nocolor-tests.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
Avoid colorization of test output in obs runners
|
||||
|
||||
Index: gevent-24.2.1/src/gevent/testing/util.py
|
||||
===================================================================
|
||||
--- gevent-24.2.1.orig/src/gevent/testing/util.py
|
||||
+++ gevent-24.2.1/src/gevent/testing/util.py
|
||||
@@ -98,6 +98,8 @@ def _color(what):
|
||||
return _color_code(_colorscheme[what])
|
||||
|
||||
def _colorize(what, message, normal='normal'):
|
||||
+ if os.environ.get("TEST_NOCOLOR", False):
|
||||
+ return message
|
||||
return _color(what) + message + _color(normal)
|
||||
|
||||
def log(message, *args, **kwargs):
|
||||
30
gh-113964-fix-tests-3.12.3.patch
Normal file
30
gh-113964-fix-tests-3.12.3.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
Index: gevent-24.2.1/src/greentest/3.12/test_subprocess.py
|
||||
===================================================================
|
||||
--- gevent-24.2.1.orig/src/greentest/3.12/test_subprocess.py
|
||||
+++ gevent-24.2.1/src/greentest/3.12/test_subprocess.py
|
||||
@@ -3404,8 +3404,9 @@ class POSIXProcessTestCase(BaseTestCase)
|
||||
atexit.register(exit_handler)
|
||||
"""
|
||||
_, out, err = assert_python_ok("-c", code)
|
||||
- self.assertEqual(out, b'')
|
||||
- self.assertIn(b"preexec_fn not supported at interpreter shutdown", err)
|
||||
+ # https://github.com/python/cpython/issues/113964
|
||||
+ # self.assertEqual(out, b'')
|
||||
+ # self.assertIn(b"preexec_fn not supported at interpreter shutdown", err)
|
||||
|
||||
|
||||
@unittest.skipUnless(mswindows, "Windows specific tests")
|
||||
Index: gevent-24.2.1/src/greentest/3.12/test_threading.py
|
||||
===================================================================
|
||||
--- gevent-24.2.1.orig/src/greentest/3.12/test_threading.py
|
||||
+++ gevent-24.2.1/src/greentest/3.12/test_threading.py
|
||||
@@ -1137,7 +1137,8 @@ class ThreadTests(BaseTestCase):
|
||||
"""
|
||||
_, out, err = assert_python_ok("-c", code)
|
||||
self.assertEqual(out, b'')
|
||||
- self.assertIn(b"can't create new thread at interpreter shutdown", err)
|
||||
+ # https://github.com/python/cpython/issues/113964
|
||||
+ # self.assertIn(b"can't create new thread at interpreter shutdown", err)
|
||||
|
||||
class ThreadJoinOnShutdown(BaseTestCase):
|
||||
|
||||
2
python-gevent-rpmlintrc
Normal file
2
python-gevent-rpmlintrc
Normal file
@@ -0,0 +1,2 @@
|
||||
addFilter("zero-length .*tests/nullcert\.pem")
|
||||
|
||||
1786
python-gevent.changes
Normal file
1786
python-gevent.changes
Normal file
File diff suppressed because it is too large
Load Diff
179
python-gevent.spec
Normal file
179
python-gevent.spec
Normal file
@@ -0,0 +1,179 @@
|
||||
#
|
||||
# spec file for package python-gevent
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
# on TW, gevent is able to use system libev, Leaps et.al. need the bundled version
|
||||
%if 0%{?suse_version} <= 1500
|
||||
%define use_bundled_libev 1
|
||||
%else
|
||||
%define use_bundled_libev 0
|
||||
%endif
|
||||
# get colored test output on local osc build
|
||||
%bcond_with colortest
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-gevent
|
||||
Version: 25.4.2
|
||||
Release: 0
|
||||
Summary: Python network library that uses greenlet and libevent
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
URL: https://www.gevent.org/
|
||||
Source0: https://github.com/gevent/gevent/archive/%{version}.tar.gz#/gevent-%{version}.tar.gz
|
||||
Source100: %{name}-rpmlintrc
|
||||
# PATCH-FEATURE-OPENSUSE gevent-opensuse-nocolor-tests.patch code@bnavigator.de -- Avoid colorization of test output in obs runners
|
||||
Patch2: gevent-opensuse-nocolor-tests.patch
|
||||
# PATCH-FEATURE-OPENSUSE gevent-openssl35-test-fix.patch pmonreal@suse.com -- Handle BrokenPipeError
|
||||
Patch3: gevent-openssl35-test-fix.patch
|
||||
BuildRequires: %{python_module Cython >= 3.0.2}
|
||||
BuildRequires: %{python_module backports.entry_points_selectable}
|
||||
BuildRequires: %{python_module cffi}
|
||||
BuildRequires: %{python_module devel >= 3.8}
|
||||
BuildRequires: %{python_module dnspython}
|
||||
BuildRequires: %{python_module greenlet >= 3.0.0}
|
||||
BuildRequires: %{python_module objgraph}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module psutil}
|
||||
BuildRequires: %{python_module requests}
|
||||
BuildRequires: %{python_module testsuite}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: %{python_module zope.event}
|
||||
BuildRequires: %{python_module zope.interface}
|
||||
BuildRequires: fdupes
|
||||
# /etc/protocols needed for tests
|
||||
BuildRequires: netcfg
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: pkgconfig(libcares)
|
||||
BuildRequires: pkgconfig(libuv)
|
||||
Requires: python-backports.entry_points_selectable
|
||||
Requires: python-cffi
|
||||
Requires: python-dnspython
|
||||
Requires: python-greenlet >= 3.0.0
|
||||
Requires: python-requests
|
||||
Requires: python-zope.event
|
||||
Requires: python-zope.interface
|
||||
%if ! 0%{use_bundled_libev}
|
||||
BuildRequires: pkgconfig(libev)
|
||||
%endif
|
||||
%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel} >= 8
|
||||
Recommends: python-psutil
|
||||
%else
|
||||
Requires: python-psutil
|
||||
%endif
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Gevent is a Python networking library that uses greenlet to provide synchronous
|
||||
API on top of a libevent event loop. Features include:
|
||||
|
||||
* Fast event loop based on libevent.
|
||||
* Lightweight execution units based on greenlet.
|
||||
* Familiar API that re-uses concepts from the Python standard library.
|
||||
* Cooperative sockets with ssl support.
|
||||
* DNS queries performed through libevent-dns.
|
||||
* Ability to use standard library and 3rd party modules written for standard
|
||||
blocking sockets
|
||||
* Fast WSGI server based on libevent-http.
|
||||
|
||||
gevent is inspired by eventlet but features more consistent API, simpler
|
||||
implementation and better performance. Read why others use gevent and check
|
||||
out the list of the open source projects based on gevent.
|
||||
|
||||
%if 0%{?suse_version} > 1500
|
||||
%package -n python-gevent-doc
|
||||
Summary: Documentation for %{name}
|
||||
Group: Documentation/Other
|
||||
Provides: %{python_module gevent-doc = %{version}}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n python-gevent-doc
|
||||
Documentation and examples for %{name}.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n gevent-%{version}
|
||||
sed -i -e '1s!bin/env python!bin/python!' examples/*.py
|
||||
sed -i -e '1{/bin.*python/d}' src/gevent/tests/*.py
|
||||
|
||||
%build
|
||||
export LIBEV_EMBED=%{use_bundled_libev}
|
||||
export CARES_EMBED=0
|
||||
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
export LIBEV_EMBED=%{use_bundled_libev}
|
||||
export CARES_EMBED=0
|
||||
%pyproject_install
|
||||
%{python_expand # fix script interpreter-line and exec bit
|
||||
sed -i '1{s|^#!.*bin.*python.*$|#!%{__$python}|}' %{buildroot}%{$python_sitearch}/gevent/testing/testrunner.py
|
||||
chmod +x %{buildroot}%{$python_sitearch}/gevent/testing/testrunner.py
|
||||
}
|
||||
%{?python_compileall}
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
|
||||
%check
|
||||
# https://www.gevent.org/development/running_tests.html
|
||||
#
|
||||
# create ignore list of tests, e.g. because they reach out to the net despite -u-network
|
||||
cat << EOF > skip_tests.txt
|
||||
test__core_stat.py
|
||||
# this one fails occasionally with: Address already in use: ('127.0.0.1', 16000)
|
||||
test__example_portforwarder.py
|
||||
# no dns resolver in obs
|
||||
test__getaddrinfo_import.py
|
||||
test__resolver_dnspython.py
|
||||
# Flaky tests in s390x architecture
|
||||
%ifarch s390x
|
||||
test__util.py
|
||||
%endif
|
||||
EOF
|
||||
|
||||
export GEVENT_RESOLVER=thread
|
||||
# Setting the TRAVIS environment variable makes some different configuration
|
||||
# for tests that use the network so they don't fail on travis (or obs)
|
||||
export TRAVIS=1
|
||||
# Setting the APPVEYOR environment variable makes the tests use a workaround
|
||||
# for Appveyor that we also need in obs for "wait_threads() failed to cleanup 1 threads"
|
||||
export APPVEYOR=1
|
||||
export LANG=en_US.UTF-8
|
||||
# Relax the crypto policies for the test-suite
|
||||
export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file
|
||||
export OPENSSL_CONF=''
|
||||
%{!?_with_colortest:export TEST_NOCOLOR=1}
|
||||
%{python_expand #
|
||||
export PYTHONPATH=%{buildroot}%{$python_sitearch}
|
||||
$python -m gevent.tests \
|
||||
--ignore skip_tests.txt \
|
||||
-u-network \
|
||||
--verbose \
|
||||
%{?jobs:--processes %jobs}
|
||||
}
|
||||
|
||||
%files %{python_files}
|
||||
%doc AUTHORS README.rst TODO CHANGES.rst CONTRIBUTING.rst
|
||||
%license LICENSE*
|
||||
%{python_sitearch}/gevent-%{version}*-info
|
||||
%{python_sitearch}/gevent
|
||||
|
||||
%if 0%{?suse_version} > 1500
|
||||
%files -n python-gevent-doc
|
||||
%license LICENSE*
|
||||
%endif
|
||||
%doc examples/
|
||||
|
||||
%changelog
|
||||
Reference in New Issue
Block a user