commit:     4430667ae7647b2cc72fa34e7d617824bb8b70ca
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 19 12:14:47 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 19 12:26:29 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4430667a

www-servers/gunicorn: Patch eventlet-related test failures

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/gunicorn-20.1.0-new-eventlet.patch       | 31 ++++++++++++++++++++++
 www-servers/gunicorn/gunicorn-20.1.0.ebuild        |  3 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/www-servers/gunicorn/files/gunicorn-20.1.0-new-eventlet.patch 
b/www-servers/gunicorn/files/gunicorn-20.1.0-new-eventlet.patch
new file mode 100644
index 00000000000..0ba4faffe63
--- /dev/null
+++ b/www-servers/gunicorn/files/gunicorn-20.1.0-new-eventlet.patch
@@ -0,0 +1,31 @@
+From a244b149b15c4417b4f0a4b4a57a1f8c296e968e Mon Sep 17 00:00:00 2001
+From: Daniel Bibik <[email protected]>
+Date: Mon, 10 May 2021 12:31:29 +0300
+Subject: [PATCH] Fix compatibility with latest eventlet
+
+Fix issue with import error while using latest eventlet (>=0.30.3).
+
+Changes made in eventlet: https://github.com/benoitc/gunicorn/pull/2581
+---
+ gunicorn/workers/geventlet.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/gunicorn/workers/geventlet.py b/gunicorn/workers/geventlet.py
+index ffdb206c0..06477e74d 100644
+--- a/gunicorn/workers/geventlet.py
++++ b/gunicorn/workers/geventlet.py
+@@ -17,7 +17,13 @@
+ 
+ from eventlet import hubs, greenthread
+ from eventlet.greenio import GreenSocket
+-from eventlet.wsgi import ALREADY_HANDLED as EVENTLET_ALREADY_HANDLED
++
++try:
++    from eventlet.wsgi import ALREADY_HANDLED as EVENTLET_ALREADY_HANDLED
++except ImportError:
++    # Since eventlet 0.30.3
++    from eventlet.wsgi import WSGI_LOCAL as EVENTLET_ALREADY_HANDLED
++
+ import greenlet
+ 
+ from gunicorn.workers.base_async import AsyncWorker

diff --git a/www-servers/gunicorn/gunicorn-20.1.0.ebuild 
b/www-servers/gunicorn/gunicorn-20.1.0.ebuild
index 937224d87db..db3c9a31a67 100644
--- a/www-servers/gunicorn/gunicorn-20.1.0.ebuild
+++ b/www-servers/gunicorn/gunicorn-20.1.0.ebuild
@@ -4,7 +4,7 @@
 EAPI=7
 
 DISTUTILS_USE_SETUPTOOLS=rdepend
-PYTHON_COMPAT=( pypy3 python3_{7..9} )
+PYTHON_COMPAT=( pypy3 python3_{8..9} )
 
 inherit distutils-r1 optfeature
 
@@ -22,6 +22,7 @@ RDEPEND="dev-python/setproctitle[${PYTHON_USEDEP}]"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-20.1.0-tests_optional_modules.patch
+       "${FILESDIR}"/${P}-new-eventlet.patch
 )
 
 DOCS=( README.rst )

Reply via email to