summaryrefslogtreecommitdiff
path: root/dev-python/eventlet
diff options
context:
space:
mode:
authorPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
committerPalica <palica+gitlab@liguros.net>2020-06-23 22:35:08 +0200
commitecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch)
treeb89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/eventlet
parent1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff)
downloadbaldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz
baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip
Updating liguros repo
Diffstat (limited to 'dev-python/eventlet')
-rw-r--r--dev-python/eventlet/Manifest1
-rw-r--r--dev-python/eventlet/eventlet-0.25.1-r1.ebuild75
-rw-r--r--dev-python/eventlet/files/eventlet-0.25.1-sparc.patch118
-rw-r--r--dev-python/eventlet/files/eventlet-0.25.1-tests.patch40
-rw-r--r--dev-python/eventlet/metadata.xml13
5 files changed, 247 insertions, 0 deletions
diff --git a/dev-python/eventlet/Manifest b/dev-python/eventlet/Manifest
new file mode 100644
index 000000000000..52d19056861a
--- /dev/null
+++ b/dev-python/eventlet/Manifest
@@ -0,0 +1 @@
+DIST eventlet-0.25.1.tar.gz 392719 BLAKE2B 7dbc23e63e9dc8b8bb0b4a53fc07cb467661bd695b6c778b973bd690bd24f3dd0f867d7ed803e1a89ffd36e5597fd244ef2c616c663d3d9130033f5f5928e816 SHA512 936aac45e24b2797cc8b6cd6238d493ce5eb60a47096e13827b8be145bd8dd14503f5ae624485c87b163718a85733b2317688366ef5fdf347f7d367fbf4d521d
diff --git a/dev-python/eventlet/eventlet-0.25.1-r1.ebuild b/dev-python/eventlet/eventlet-0.25.1-r1.ebuild
new file mode 100644
index 000000000000..f5ec914ba9c1
--- /dev/null
+++ b/dev-python/eventlet/eventlet-0.25.1-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8,9} )
+
+inherit distutils-r1
+
+DESCRIPTION="Highly concurrent networking library"
+HOMEPAGE="https://pypi.org/project/eventlet/ https://github.com/eventlet/eventlet/"
+SRC_URI="mirror://pypi/e/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc x86"
+IUSE="doc examples test"
+
+RDEPEND="
+ >=dev-python/dnspython-1.15.0[${PYTHON_USEDEP}]
+ >=dev-python/greenlet-0.3[${PYTHON_USEDEP}]
+ >=dev-python/monotonic-1.4[${PYTHON_USEDEP}]
+ >=dev-python/six-1.10.0[${PYTHON_USEDEP}]"
+DEPEND="doc? ( >=dev-python/python-docs-2.7.6-r1:2.7 )
+ test? ( ${RDEPEND}
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}] )"
+
+PATCHES=(
+ "${FILESDIR}/eventlet-0.25.1-sparc.patch"
+ "${FILESDIR}/eventlet-0.25.1-tests.patch"
+)
+
+distutils_enable_sphinx doc
+distutils_enable_tests nose
+
+python_prepare_all() {
+ # provided by virtual/python-enum34
+ sed -i '/enum-compat/d' setup.py || die
+
+ if use doc; then
+ local PYTHON_DOC_ATOM=$(best_version -b dev-python/python-docs:2.7)
+ local PYTHON_DOC_VERSION="${PYTHON_DOC_ATOM#dev-python/python-docs-}"
+ local PYTHON_DOC="/usr/share/doc/python-docs-${PYTHON_DOC_VERSION}/html"
+ local PYTHON_DOC_INVENTORY="${PYTHON_DOC}/objects.inv"
+ sed -i "s|'https://docs.python.org/': None|'${PYTHON_DOC}': '${PYTHON_DOC_INVENTORY}'|" doc/conf.py || die
+ fi
+
+ if use test; then
+# sed -i '/This is a Python 3 module/d' eventlet/green/http/__init__.py || die
+# sed -i 's/^import/from OpenSSL import/g' eventlet/green/OpenSSL/__init__.py || die
+# sed -i 's/^from version/from OpenSSL.version/' eventlet/green/OpenSSL/__init__.py || die
+ sed -i 's/TEST_TIMEOUT = 1/TEST_TIMEOUT = 10/' tests/__init__.py || die
+ fi
+
+ # Prevent file collisions from teestsuite
+ sed -e "s:'tests', :'tests', 'tests.*', :" -i setup.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_prepare() {
+ if ! python_is_python3; then
+ # this is for python3 only
+ rm -r eventlet/green/http || die
+ fi
+}
+
+python_install_all() {
+ if use examples; then
+ docompress -x "/usr/share/doc/${PF}/examples"
+ docinto examples
+ dodoc -r examples/.
+ fi
+ distutils-r1_python_install_all
+}
diff --git a/dev-python/eventlet/files/eventlet-0.25.1-sparc.patch b/dev-python/eventlet/files/eventlet-0.25.1-sparc.patch
new file mode 100644
index 000000000000..c7f6a75b4f3c
--- /dev/null
+++ b/dev-python/eventlet/files/eventlet-0.25.1-sparc.patch
@@ -0,0 +1,118 @@
+From b288e969b6a0ed24913114b7b7eaad5010db5ce1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 29 May 2020 09:04:37 +0200
+Subject: [PATCH 1/4] tests: F_SETFL does not return flags, use F_GETFL again
+
+Fix TestGreenSocket.test_skip_nonblocking() to call F_GETFL again
+to get the flags for the socket. Previously, the code wrongly assumed
+F_SETFL will return flags while it always returns 0 (see fcntl(2)).
+---
+ tests/greenio_test.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/greenio_test.py b/tests/greenio_test.py
+index 39d77737b..593444d07 100644
+--- a/tests/greenio_test.py
++++ b/tests/greenio_test.py
+@@ -634,7 +634,8 @@ def test_skip_nonblocking(self):
+ sock1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ fd = sock1.fd.fileno()
+ flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+- flags = fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)
++ fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)
++ flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+ assert flags & os.O_NONBLOCK == 0
+
+ sock2 = socket.socket(sock1.fd, set_nonblocking=False)
+
+From 803422302f5e813f1f00435d7ae943bf8513946c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 29 May 2020 09:07:17 +0200
+Subject: [PATCH 2/4] tests: Unset O_NONBLOCK|O_NDELAY to fix SPARC
+
+Fix TestGreenSocket.test_skip_nonblocking() to unset both O_NONBLOCK
+and O_NDELAY. This is necessary to fix tests on SPARC where both flags
+are used simultaneously, and unsetting one is ineffective (flags remain
+the same). This should not affect other platforms where O_NDELAY
+is an alias for O_NONBLOCK.
+---
+ tests/greenio_test.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/greenio_test.py b/tests/greenio_test.py
+index 593444d07..736c2e539 100644
+--- a/tests/greenio_test.py
++++ b/tests/greenio_test.py
+@@ -634,7 +634,9 @@ def test_skip_nonblocking(self):
+ sock1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ fd = sock1.fd.fileno()
+ flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+- fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)
++ # on SPARC, nonblocking mode sets O_NDELAY as well
++ fcntl.fcntl(fd, fcntl.F_SETFL, flags & ~(os.O_NONBLOCK
++ | os.O_NDELAY))
+ flags = fcntl.fcntl(fd, fcntl.F_GETFL)
+ assert flags & os.O_NONBLOCK == 0
+
+
+From b742b443d079ec9001a1452e138773b066ed784e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 29 May 2020 09:09:07 +0200
+Subject: [PATCH 3/4] tests: Assume that nonblocking mode might set O_NDELAY to
+ fix SPARC
+
+Fix test_set_nonblocking() to account for the alternative possible
+outcome that enabling non-blocking mode can set both O_NONBLOCK
+and O_NDELAY as it does on SPARC. Note that O_NDELAY may be a superset
+of O_NONBLOCK, so we can't just filter it out of new_flags.
+---
+ tests/greenio_test.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/tests/greenio_test.py b/tests/greenio_test.py
+index 736c2e539..a2d1ad856 100644
+--- a/tests/greenio_test.py
++++ b/tests/greenio_test.py
+@@ -925,7 +925,10 @@ def test_set_nonblocking():
+ assert orig_flags & os.O_NONBLOCK == 0
+ greenio.set_nonblocking(sock)
+ new_flags = fcntl.fcntl(fileno, fcntl.F_GETFL)
+- assert new_flags == (orig_flags | os.O_NONBLOCK)
++ # on SPARC, O_NDELAY is set as well, and it might be a superset
++ # of O_NONBLOCK
++ assert (new_flags == (orig_flags | os.O_NONBLOCK)
++ or new_flags == (orig_flags | os.O_NONBLOCK | os.O_NDELAY))
+
+
+ def test_socket_del_fails_gracefully_when_not_fully_initialized():
+
+From d324431b14ea57c6d7b295bd8b00f128ed4c2f5a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 29 May 2020 09:17:21 +0200
+Subject: [PATCH 4/4] tests: Increase timeout for
+ test_isolate_from_socket_default_timeout
+
+Increase the timeout used for test_isolate_from_socket_default_timeout
+from 1 second to 5 seconds. Otherwise, the test can't succeed
+on hardware where Python runs slower. In particular, on our SPARC box
+importing greenlet modules takes almost 2 seconds, so the test program
+does not even start properly.
+
+Fixes #614
+---
+ tests/tpool_test.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/tpool_test.py b/tests/tpool_test.py
+index 4826f30de..1a730dc10 100644
+--- a/tests/tpool_test.py
++++ b/tests/tpool_test.py
+@@ -366,7 +366,7 @@ def test_leakage_from_tracebacks(self):
+
+
+ def test_isolate_from_socket_default_timeout():
+- tests.run_isolated('tpool_isolate_socket_default_timeout.py', timeout=1)
++ tests.run_isolated('tpool_isolate_socket_default_timeout.py', timeout=5)
+
+
+ def test_exception_leak():
diff --git a/dev-python/eventlet/files/eventlet-0.25.1-tests.patch b/dev-python/eventlet/files/eventlet-0.25.1-tests.patch
new file mode 100644
index 000000000000..423f8ef8e408
--- /dev/null
+++ b/dev-python/eventlet/files/eventlet-0.25.1-tests.patch
@@ -0,0 +1,40 @@
+diff --git a/tests/ssl_test.py b/tests/ssl_test.py
+index d8b7d7e..5a3580b 100644
+--- a/tests/ssl_test.py
++++ b/tests/ssl_test.py
+@@ -180,7 +180,6 @@ class SSLTest(tests.LimitedTestCase):
+ self.assertEqual(client.recv(8), b'response')
+ stage_1.send()
+
+- tests.check_idle_cpu_usage(0.2, 0.1)
+ server_coro.kill()
+
+ def test_greensslobject(self):
+diff --git a/tests/zmq_test.py b/tests/zmq_test.py
+index 601878f..c643e48 100644
+--- a/tests/zmq_test.py
++++ b/tests/zmq_test.py
+@@ -432,6 +432,8 @@ class TestUpstreamDownStream(tests.LimitedTestCase):
+ events = sock2.getsockopt(zmq.EVENTS)
+ self.assertEqual(events & zmq.POLLIN, zmq.POLLIN)
+
++ # this will often fail on portage...
++ @tests.skip_if(True)
+ @tests.skip_unless(zmq_supported)
+ def test_cpu_usage_after_bind(self):
+ """zmq eats CPU after PUB socket .bind()
+@@ -461,14 +463,12 @@ class TestUpstreamDownStream(tests.LimitedTestCase):
+ sub.setsockopt(zmq.SUBSCRIBE, b"")
+ eventlet.sleep()
+ pub.send(b'test_send')
+- tests.check_idle_cpu_usage(0.2, 0.1)
+
+ sender, receiver, _port = self.create_bound_pair(zmq.DEALER, zmq.DEALER)
+ eventlet.sleep()
+ sender.send(b'test_recv')
+ msg = receiver.recv()
+ self.assertEqual(msg, b'test_recv')
+- tests.check_idle_cpu_usage(0.2, 0.1)
+
+
+ class TestQueueLock(tests.LimitedTestCase):
diff --git a/dev-python/eventlet/metadata.xml b/dev-python/eventlet/metadata.xml
new file mode 100644
index 000000000000..e6afaec90883
--- /dev/null
+++ b/dev-python/eventlet/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">eventlet</remote-id>
+ <remote-id type="github">eventlet/eventlet</remote-id>
+ </upstream>
+ <origin>gentoo-staging</origin>
+</pkgmetadata>