[arch-commits] Commit in python-eventlet/repos (4 files)

Levente Polyak anthraxx at archlinux.org
Sun Dec 13 16:11:23 UTC 2015


    Date: Sunday, December 13, 2015 @ 17:11:22
  Author: anthraxx
Revision: 153179

archrelease: copy trunk to community-any

Added:
  python-eventlet/repos/community-any/
  python-eventlet/repos/community-any/PKGBUILD
    (from rev 153178, python-eventlet/trunk/PKGBUILD)
  python-eventlet/repos/community-any/fix-mswindows-regression.patch
    (from rev 153178, python-eventlet/trunk/fix-mswindows-regression.patch)
  python-eventlet/repos/community-any/fix-openssl.patch
    (from rev 153178, python-eventlet/trunk/fix-openssl.patch)

--------------------------------+
 PKGBUILD                       |   86 +++++++++++++++++++++++++++++++++++++++
 fix-mswindows-regression.patch |   42 +++++++++++++++++++
 fix-openssl.patch              |   51 +++++++++++++++++++++++
 3 files changed, 179 insertions(+)

Copied: python-eventlet/repos/community-any/PKGBUILD (from rev 153178, python-eventlet/trunk/PKGBUILD)
===================================================================
--- community-any/PKGBUILD	                        (rev 0)
+++ community-any/PKGBUILD	2015-12-13 16:11:22 UTC (rev 153179)
@@ -0,0 +1,86 @@
+# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
+
+pkgbase=python-eventlet
+pkgname=('python-eventlet' 'python2-eventlet')
+_pyname=eventlet
+pkgver=0.17.4
+pkgrel=2
+pkgdesc='Highly concurrent networking library'
+url='http://eventlet.net'
+arch=('any')
+license=('MIT')
+makedepends=('python-greenlet' 'python-setuptools' 'python-sphinx' 'python2-greenlet' 'python2-setuptools' 'python2-sphinx')
+#TODO: add 'python-dnspython' if test is fixed
+checkdepends=('python-psycopg2' 'python-nose' 'python-pyopenssl' 'python-httplib2' 'python-mock' 'python-pyzmq'
+              'python2-psycopg2' 'python2-nose' 'python2-pyopenssl' 'python2-httplib2' 'python2-mock' 'python2-pyzmq' 'python2-dnspython')
+source=(${pkgbase}-${pkgver}.tar.gz::https://github.com/eventlet/eventlet/archive/v${pkgver}.tar.gz
+        fix-mswindows-regression.patch
+        fix-openssl.patch)
+sha512sums=('a58e39b275c8100e79d837d37c2bfee30e63396c24c7b1058709d08272bd5a39aa4fb5c7278fc72816e371f45deba83664c366996db2261181d4caa9e8526da0'
+            '6db8a6e852be0628c7e7b1290241f0918bb2aa204ea1ce969cc030126170bd1e6094c338ca0d7efbba1861c899997bc932c258b778a4610e956b266a83835d14'
+            '029b92dc19b2877fc65ee2407f06d9de221e0f4c7a977123ca0977830a15b0336af37fbc3ea20dbb54e5ddb7b59df4d805faf943f510d32837a907ba5715408a')
+
+prepare() {
+  (cd ${_pyname}-${pkgver}
+    patch -p1 < "${srcdir}/fix-mswindows-regression.patch"
+    patch -p1 < "${srcdir}/fix-openssl.patch"
+    sed -r 's|(check_idle_cpu_usage\(.*,) .*\)|\1 0.8\)|g' -i tests/*_test.py
+    sed 's|json|text|g' -i doc/Makefile
+  )
+  cp -a ${_pyname}-${pkgver}{,-py2}
+  sed 's|python|python2|' -i ${_pyname}-${pkgver}-py2/examples/*
+}
+
+build() {
+  (cd ${_pyname}-${pkgver}
+    python setup.py build
+    make -C doc text
+  )
+  (cd ${_pyname}-${pkgver}-py2
+    python2 setup.py build
+    make -C doc text
+  )
+}
+
+check() {
+  (cd ${_pyname}-${pkgver}
+    nosetests -sv tests
+  )
+  (cd ${_pyname}-${pkgver}-py2
+    nosetests2 -sv tests
+  )
+}
+
+package_python-eventlet() {
+  depends=('python' 'python-greenlet')
+  optdepends=('python-psycopg2: non-blocking PostgreSQL support'
+              'python-pyopenssl: non-blocking SSL support'
+              'python-httplib2: non-blocking HTTP support'
+              'python-pyzmq: non-blocking ZeroMQ support'
+              'python-dnspython: non-blocking DNS support')
+
+  cd ${_pyname}-${pkgver}
+  python setup.py install --prefix=/usr --root="${pkgdir}" -O1
+  install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+  install -d "${pkgdir}/usr/share/doc/${pkgname}"
+  cp -r doc/_build/text "${pkgdir}/usr/share/doc/${pkgname}"
+  cp -r examples "${pkgdir}/usr/share/doc/${pkgname}"
+}
+
+package_python2-eventlet() {
+  depends=('python2' 'python2-greenlet')
+  optdepends=('python2-psycopg2: non-blocking PostgreSQL support'
+              'python2-pyopenssl: non-blocking SSL support'
+              'python2-httplib2: non-blocking HTTP support'
+              'python2-pyzmq: non-blocking ZeroMQ support'
+              'python2-dnspython: non-blocking DNS support')
+
+  cd ${_pyname}-${pkgver}-py2
+  python2 setup.py install --prefix=/usr --root="${pkgdir}" -O1
+  install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+  install -d "${pkgdir}/usr/share/doc/${pkgname}"
+  cp -r doc/_build/text "${pkgdir}/usr/share/doc/${pkgname}"
+  cp -r examples "${pkgdir}/usr/share/doc/${pkgname}"
+}
+
+# vim: ts=2 sw=2 et:

Copied: python-eventlet/repos/community-any/fix-mswindows-regression.patch (from rev 153178, python-eventlet/trunk/fix-mswindows-regression.patch)
===================================================================
--- community-any/fix-mswindows-regression.patch	                        (rev 0)
+++ community-any/fix-mswindows-regression.patch	2015-12-13 16:11:22 UTC (rev 153179)
@@ -0,0 +1,42 @@
+From da7f9732b6d9d52c8bca5cdbb536beb1fac14b44 Mon Sep 17 00:00:00 2001
+From: Jakub Stasiak <jakub at stasiak.at>
+Date: Wed, 4 Nov 2015 23:38:33 +0100
+Subject: [PATCH] subprocess: Fix Python 3.5 mswindows regression
+
+In Python 3.5 subprocess.mswindows no longer exists. It is renamed to
+subprocess._mswindows, I decided we don't really have to access that
+now "private" attribute in order to know if we're on MS Windows.
+---
+ eventlet/green/subprocess.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/eventlet/green/subprocess.py b/eventlet/green/subprocess.py
+index 8a2cd50..1347404 100644
+--- a/eventlet/green/subprocess.py
++++ b/eventlet/green/subprocess.py
+@@ -17,6 +17,7 @@
+ 
+ patcher.inject('subprocess', globals(), *to_patch)
+ subprocess_orig = __import__("subprocess")
++mswindows = sys.platform == "win32"
+ 
+ 
+ if getattr(subprocess_orig, 'TimeoutExpired', None) is None:
+@@ -46,7 +47,7 @@ class Popen(subprocess_orig.Popen):
+     # Windows. (see eventlet.greenio.set_nonblocking()) As the sole purpose of
+     # this __init__() override is to wrap the pipes for eventlet-friendly
+     # non-blocking I/O, don't even bother overriding it on Windows.
+-    if not subprocess_orig.mswindows:
++    if not mswindows:
+         def __init__(self, args, bufsize=0, *argss, **kwds):
+             self.args = args
+             # Forward the call to base-class constructor
+@@ -93,7 +94,7 @@ def wait(self, timeout=None, check_interval=0.01):
+                 raise
+     wait.__doc__ = subprocess_orig.Popen.wait.__doc__
+ 
+-    if not subprocess_orig.mswindows:
++    if not mswindows:
+         # don't want to rewrite the original _communicate() method, we
+         # just want a version that uses eventlet.green.select.select()
+         # instead of select.select().

Copied: python-eventlet/repos/community-any/fix-openssl.patch (from rev 153178, python-eventlet/trunk/fix-openssl.patch)
===================================================================
--- community-any/fix-openssl.patch	                        (rev 0)
+++ community-any/fix-openssl.patch	2015-12-13 16:11:22 UTC (rev 153179)
@@ -0,0 +1,51 @@
+From e9f19c6df4a6e97a36a974338196a5a0bda079e4 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <vstinner at redhat.com>
+Date: Mon, 29 Jun 2015 16:03:56 +0200
+Subject: [PATCH] Port eventlet.green.OpenSSL to Python 3
+
+* Fix import syntax for Python 3: use relative imports
+* Add unit test
+---
+ eventlet/green/OpenSSL/__init__.py | 10 +++++-----
+ tests/openssl_test.py              | 17 +++++++++++++++++
+ 2 files changed, 22 insertions(+), 5 deletions(-)
+ create mode 100644 tests/openssl_test.py
+
+diff --git a/eventlet/green/OpenSSL/__init__.py b/eventlet/green/OpenSSL/__init__.py
+index 56bfb8a..26b60d9 100644
+--- a/eventlet/green/OpenSSL/__init__.py
++++ b/eventlet/green/OpenSSL/__init__.py
+@@ -1,5 +1,5 @@
+-import rand
+-import crypto
+-import SSL
+-import tsafe
+-from version import __version__
++from . import rand
++from . import crypto
++from . import SSL
++from . import tsafe
++from .version import __version__
+diff --git a/tests/openssl_test.py b/tests/openssl_test.py
+new file mode 100644
+index 0000000..a4498dc
+--- /dev/null
++++ b/tests/openssl_test.py
+@@ -0,0 +1,17 @@
++import tests
++
++
++def test_import():
++    # https://github.com/eventlet/eventlet/issues/238
++    # Ensure that it's possible to import eventlet.green.OpenSSL.
++    # Most basic test to check Python 3 compatibility.
++    try:
++        import OpenSSL
++    except ImportError:
++        raise tests.SkipTest('need pyopenssl')
++
++    import eventlet.green.OpenSSL.SSL
++    import eventlet.green.OpenSSL.crypto
++    import eventlet.green.OpenSSL.rand
++    import eventlet.green.OpenSSL.tsafe
++    import eventlet.green.OpenSSL.version



More information about the arch-commits mailing list