diff --git a/eventlet-0.23.0.tar.gz b/eventlet-0.23.0.tar.gz new file mode 100644 index 0000000..810af91 Binary files /dev/null and b/eventlet-0.23.0.tar.gz differ diff --git a/python-eventlet.spec b/python-eventlet.spec new file mode 100644 index 0000000..5012fe2 --- /dev/null +++ b/python-eventlet.spec @@ -0,0 +1,119 @@ +Name: python-eventlet +Version: 0.23.0 +Release: 3 +Summary: Highly concurrent networking library +License: MIT +URL: http://eventlet.net +Source0: https://files.pythonhosted.org/packages/72/c5/3f028be460dd4b425b27afd88e3a7380ecb3542a9968271a38ae15682a19/eventlet-0.23.0.tar.gz +Patch0: https://github.com/eventlet/eventlet/pull/506.patch#/python37.patch + +BuildArch: noarch + +%description +Eventlet is a concurrent networking library for Python that allows you +to change how you run your code, not how you write it. + +It uses epoll or libevent for highly scalable non-blocking I/O. +Coroutines ensure that the developer uses a blocking style of programming +that is similar to threading, but provide the benefits of non-blocking I/O. +The event dispatch is implicit, which means you can easily use Eventlet +from the Python interpreter, or as a small part of a larger application. + +%package -n python2-eventlet +Summary: Highly concurrent networking library +BuildRequires: python2-devel python2-setuptools python2-nose python2-greenlet python2-pyOpenSSL +Requires: python2-greenlet python2-enum34 +%python_provide python2-eventlet + +%description -n python2-eventlet +ntlet is a concurrent networking library for Python that allows you +to change how you run your code, not how you write it. + +It uses epoll or libevent for highly scalable non-blocking I/O. +Coroutines ensure that the developer uses a blocking style of programming +that is similar to threading, but provide the benefits of non-blocking I/O. +The event dispatch is implicit, which means you can easily use Eventlet +from the Python interpreter, or as a small part of a larger application. + +%package -n python3-eventlet +Summary: Highly concurrent networking library +BuildArch: noarch +BuildRequires: python3-devel python3-setuptools python3-nose python3-greenlet python3-pyOpenSSL +Requires: python3-greenlet +%python_provide python3-eventlet + +%description -n python3-eventlet +ntlet is a concurrent networking library for Python that allows you +to change how you run your code, not how you write it. + +It uses epoll or libevent for highly scalable non-blocking I/O. +Coroutines ensure that the developer uses a blocking style of programming +that is similar to threading, but provide the benefits of non-blocking I/O. +The event dispatch is implicit, which means you can easily use Eventlet +from the Python interpreter, or as a small part of a larger application. + +%package -n python2-eventlet-help +Summary: Documentation for python2-eventlet +BuildRequires: python2-sphinx python2-zmq +%python_provide python2-eventlet-help +Provides: python2-eventlet-doc = %{version}-%{release} +Obsoletes: python2-eventlet-doc < %{version}-%{release} + +%description -n python2-eventlet-help +Documentation for python2-eventlet + +%package -n python3-eventlet-help +Summary: Documentation for python3-eventlet +BuildRequires: python3-sphinx python3-zmq +Provides: python3-eventlet-doc = %{version}-%{release} +Obsoletes: python3-eventlet-doc < %{version}-%{release} + +%description -n python3-eventlet-help +Documentation for python3-eventlet + +%prep +%autosetup -n eventlet-%{version} -p1 +rm -vrf *.egg-info +sed -i "/'enum-compat',/d" setup.py + +%build +%py2_build +%py3_build + +export PYTHONPATH=$(pwd) +sphinx-build-%{python2_version} -b html -d doctrees doc html-2 +sphinx-build-%{python3_version} -b html -d doctrees doc html-3 + +%install +%py2_install +rm -rf %{buildroot}/%{python2_sitelib}/eventlet/green/http/{cookiejar,client}.py +%py3_install + +%check +nosetests-%{python3_version} -v + +%files -n python2-eventlet +%exclude %{python2_sitelib}/tests +%exclude %{python3_sitelib}/tests +%doc README.rst AUTHORS LICENSE NEWS +%license LICENSE +%{python2_sitelib}/eventlet/ +%{python2_sitelib}/eventlet-*.egg-info/ + +%files -n python3-eventlet +%doc README.rst AUTHORS LICENSE NEWS +%license LICENSE +%{python3_sitelib}/eventlet/ +%{python3_sitelib}/eventlet-*.egg-info/ + +%files -n python2-eventlet-help +%license LICENSE +%doc html-2 + +%files -n python3-eventlet-help +%license LICENSE +%doc html-3 + +%changelog +* Thu Mar 12 2020 zoushuangshuang - 0.23.0-3 +- Package init diff --git a/python37.patch b/python37.patch new file mode 100644 index 0000000..62816ba --- /dev/null +++ b/python37.patch @@ -0,0 +1,140 @@ +From 0d4e7bcb90800d6700b2c81c41c9770ee5f94358 Mon Sep 17 00:00:00 2001 +From: Marcel Plch +Date: Mon, 9 Jul 2018 16:45:45 +0200 +Subject: [PATCH] Fix for Python 3.7 + +--- + eventlet/green/ssl.py | 46 ++++++++++++++++++++++++++++++++++++++++------ + tests/debug_test.py | 14 ++++++++++++-- + tests/hub_test.py | 4 +++- + 3 files changed, 55 insertions(+), 9 deletions(-) + +diff --git a/eventlet/green/ssl.py b/eventlet/green/ssl.py +index 53ee9a3c..df72869e 100644 +--- a/eventlet/green/ssl.py ++++ b/eventlet/green/ssl.py +@@ -24,6 +24,7 @@ + 'create_default_context', '_create_default_https_context'] + + _original_sslsocket = __ssl.SSLSocket ++_original_wrap_socket = __ssl.wrap_socket + + + class GreenSSLSocket(_original_sslsocket): +@@ -57,11 +58,41 @@ def __init__(self, sock, keyfile=None, certfile=None, + # this assignment + self._timeout = sock.gettimeout() + +- # nonblocking socket handshaking on connect got disabled so let's pretend it's disabled +- # even when it's on +- super(GreenSSLSocket, self).__init__( +- sock.fd, keyfile, certfile, server_side, cert_reqs, ssl_version, +- ca_certs, do_handshake_on_connect and six.PY2, *args, **kw) ++ if sys.version_info >= (3, 7): ++ # Monkey-patch the sslsocket so our modified self gets ++ # injected into its _create method. ++ def fake_new(self, cls, *args, **kwargs): ++ return self ++ ++ orig_new = _original_sslsocket.__new__ ++ try: ++ _original_sslsocket.__new__ = fake_new.__get__(self, GreenSSLSocket) ++ ++ self = _original_wrap_socket( ++ sock=sock.fd, ++ keyfile=keyfile, ++ certfile=certfile, ++ server_side=server_side, ++ cert_reqs=cert_reqs, ++ ssl_version=ssl_version, ++ ca_certs=ca_certs, ++ do_handshake_on_connect=do_handshake_on_connect and six.PY2, ++ *args, **kw ++ ) ++ self.keyfile = keyfile ++ self.certfile = certfile ++ self.cert_reqs = cert_reqs ++ self.ssl_version = ssl_version ++ self.ca_certs = ca_certs ++ finally: ++ # Unpatch ++ _original_sslsocket.__new__ = orig_new ++ else: ++ # nonblocking socket handshaking on connect got disabled so let's pretend it's disabled ++ # even when it's on ++ super(GreenSSLSocket, self).__init__( ++ sock.fd, keyfile, certfile, server_side, cert_reqs, ssl_version, ++ ca_certs, do_handshake_on_connect and six.PY2, *args, **kw) + + # the superclass initializer trashes the methods so we remove + # the local-object versions of them and let the actual class +@@ -323,7 +354,10 @@ def connect(self, addr): + except NameError: + self._sslobj = sslobj + else: +- self._sslobj = SSLObject(sslobj, owner=self) ++ if sys.version_info < (3, 7): ++ self._sslobj = SSLObject(sslobj, owner=self) ++ else: ++ self._sslobj = sslobj + + if self.do_handshake_on_connect: + self.do_handshake() +diff --git a/tests/debug_test.py b/tests/debug_test.py +index 8299dede..82b3a834 100644 +--- a/tests/debug_test.py ++++ b/tests/debug_test.py +@@ -29,6 +29,11 @@ def test_unspew(self): + assert self.tracer is None + + def test_line(self): ++ if sys.version_info >= (3, 7): ++ frame_str = "f== (3, 7): ++ frame_str = "f=