[arch-commits] Commit in python-tornado/repos (8 files)

Felix Yan fyan at archlinux.org
Sun Feb 8 11:37:38 UTC 2015


    Date: Sunday, February 8, 2015 @ 12:37:38
  Author: fyan
Revision: 127298

archrelease: copy trunk to community-testing-i686, community-testing-x86_64

Added:
  python-tornado/repos/community-testing-i686/
  python-tornado/repos/community-testing-i686/0001-use_system_ca_certificates.patch
    (from rev 127297, python-tornado/trunk/0001-use_system_ca_certificates.patch)
  python-tornado/repos/community-testing-i686/0002-get-rid-of-backports-ssl-match-hostname.patch
    (from rev 127297, python-tornado/trunk/0002-get-rid-of-backports-ssl-match-hostname.patch)
  python-tornado/repos/community-testing-i686/PKGBUILD
    (from rev 127297, python-tornado/trunk/PKGBUILD)
  python-tornado/repos/community-testing-x86_64/
  python-tornado/repos/community-testing-x86_64/0001-use_system_ca_certificates.patch
    (from rev 127297, python-tornado/trunk/0001-use_system_ca_certificates.patch)
  python-tornado/repos/community-testing-x86_64/0002-get-rid-of-backports-ssl-match-hostname.patch
    (from rev 127297, python-tornado/trunk/0002-get-rid-of-backports-ssl-match-hostname.patch)
  python-tornado/repos/community-testing-x86_64/PKGBUILD
    (from rev 127297, python-tornado/trunk/PKGBUILD)

-----------------------------------------------------------------------------+
 community-testing-i686/0001-use_system_ca_certificates.patch                |   57 ++++++
 community-testing-i686/0002-get-rid-of-backports-ssl-match-hostname.patch   |   23 ++
 community-testing-i686/PKGBUILD                                             |   82 ++++++++++
 community-testing-x86_64/0001-use_system_ca_certificates.patch              |   57 ++++++
 community-testing-x86_64/0002-get-rid-of-backports-ssl-match-hostname.patch |   23 ++
 community-testing-x86_64/PKGBUILD                                           |   82 ++++++++++
 6 files changed, 324 insertions(+)

Copied: python-tornado/repos/community-testing-i686/0001-use_system_ca_certificates.patch (from rev 127297, python-tornado/trunk/0001-use_system_ca_certificates.patch)
===================================================================
--- community-testing-i686/0001-use_system_ca_certificates.patch	                        (rev 0)
+++ community-testing-i686/0001-use_system_ca_certificates.patch	2015-02-08 11:37:38 UTC (rev 127298)
@@ -0,0 +1,57 @@
+diff --git a/setup.py b/setup.py
+index f09169f..d42c486 100644
+--- a/setup.py
++++ b/setup.py
+@@ -120,7 +120,7 @@ if (platform.python_implementation() == 'CPython' and
+ 
+ if setuptools is not None:
+     # If setuptools is not available, you're on your own for dependencies.
+-    install_requires = ['certifi']
++    install_requires = []
+     if sys.version_info < (3, 2):
+         install_requires.append('backports.ssl_match_hostname')
+     kwargs['install_requires'] = install_requires
+diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py
+index f0f73fa..ffe3e40 100644
+--- a/tornado/simple_httpclient.py
++++ b/tornado/simple_httpclient.py
+@@ -33,17 +33,9 @@ except ImportError:
+     # ssl is not available on Google App Engine.
+     ssl = None
+ 
+-try:
+-    import certifi
+-except ImportError:
+-    certifi = None
+-
+ 
+ def _default_ca_certs():
+-    if certifi is None:
+-        raise Exception("The 'certifi' package is required to use https "
+-                        "in simple_httpclient")
+-    return certifi.where()
++    return "/etc/ssl/certs/ca-certificates.crt"
+ 
+ 
+ class SimpleAsyncHTTPClient(AsyncHTTPClient):
+diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py
+index 01b0d95..47a64e7 100644
+--- a/tornado/test/iostream_test.py
++++ b/tornado/test/iostream_test.py
+@@ -10,7 +10,6 @@ from tornado.stack_context import NullContext
+ from tornado.testing import AsyncHTTPTestCase, AsyncHTTPSTestCase, AsyncTestCase, bind_unused_port, ExpectLog, gen_test
+ from tornado.test.util import unittest, skipIfNonUnix
+ from tornado.web import RequestHandler, Application
+-import certifi
+ import errno
+ import logging
+ import os
+@@ -855,7 +854,7 @@ class TestIOStreamStartTLS(AsyncTestCase):
+     def test_handshake_fail(self):
+         self.server_start_tls(_server_ssl_options())
+         client_future = self.client_start_tls(
+-            dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs=certifi.where()))
++            dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs="/etc/ssl/certs/ca-certificates.crt"))
+         with ExpectLog(gen_log, "SSL Error"):
+             with self.assertRaises(ssl.SSLError):
+                 yield client_future

Copied: python-tornado/repos/community-testing-i686/0002-get-rid-of-backports-ssl-match-hostname.patch (from rev 127297, python-tornado/trunk/0002-get-rid-of-backports-ssl-match-hostname.patch)
===================================================================
--- community-testing-i686/0002-get-rid-of-backports-ssl-match-hostname.patch	                        (rev 0)
+++ community-testing-i686/0002-get-rid-of-backports-ssl-match-hostname.patch	2015-02-08 11:37:38 UTC (rev 127298)
@@ -0,0 +1,23 @@
+From f8f2ffca1928aeca2fa9771093436dba49baa538 Mon Sep 17 00:00:00 2001
+From: Felix Yan <felixonmars at gmail.com>
+Date: Fri, 12 Dec 2014 23:10:15 +0800
+Subject: [PATCH] Don't depend on backports.ssl-match-hostname with python
+ >=2.7.9, <3.0
+
+---
+ setup.py               | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index f09169f..f795807 100644
+--- a/setup.py
++++ b/setup.py
+@@ -121,7 +121,7 @@ def build_extension(self, ext):
+ if setuptools is not None:
+     # If setuptools is not available, you're on your own for dependencies.
+     install_requires = []
+-    if sys.version_info < (3, 2):
++    if sys.version_info < (2, 7, 9) or (3, 0) <= sys.version_info < (3, 2):
+         install_requires.append('backports.ssl_match_hostname')
+     kwargs['install_requires'] = install_requires
+ 

Copied: python-tornado/repos/community-testing-i686/PKGBUILD (from rev 127297, python-tornado/trunk/PKGBUILD)
===================================================================
--- community-testing-i686/PKGBUILD	                        (rev 0)
+++ community-testing-i686/PKGBUILD	2015-02-08 11:37:38 UTC (rev 127298)
@@ -0,0 +1,82 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Thomas Dziedzic < gostrc at gmail >
+
+pkgname=('python-tornado' 'python2-tornado')
+pkgver=4.1.0
+pkgrel=1
+pkgdesc='open source version of the scalable, non-blocking web server and tools'
+arch=('i686' 'x86_64')
+url='http://www.tornadoweb.org/'
+license=('Apache')
+makedepends=('python-setuptools' 'python2-setuptools' 'git')
+checkdepends=('python-pycurl' 'python2-pycurl' 'python-mock' 'python2-mock' 'python-twisted' 'python2-twisted' 'python2-futures' 'python2-singledispatch')
+source=("git+https://github.com/facebook/tornado.git#tag=v$pkgver"
+        0001-use_system_ca_certificates.patch
+        0002-get-rid-of-backports-ssl-match-hostname.patch)
+sha512sums=('SKIP'
+            '6e50e9ecf361d54d9f67e1f12185cf58863ad0eae72fbe7cc24e8eaf94874255009a030249bb51adf06e98c7ed0b17d8c6d9ee65190ebc341d6857c0efbc7840'
+            '798f1c5f659138aa4d775edde7c962ec6410671f528b7ec44ca12ac342ddf9ec51d998c676b9025292a58c2140ba8492fcc76759b63adaf08320f96b11bcbfea')
+
+prepare() {
+  cd tornado
+  patch -p1 -i ../0001-use_system_ca_certificates.patch
+  patch -p1 -i ../0002-get-rid-of-backports-ssl-match-hostname.patch
+
+  cd "$srcdir"
+  cp -a tornado{,-py2}
+
+  # python -> python2 rename
+  find tornado-py2 -name '*py' -exec sed -e 's_#!/usr/bin/env python_&2_' -i {} \;
+}
+
+build() {
+  cd tornado
+  python setup.py build
+
+  cd ../tornado-py2
+  python2 setup.py build
+}
+
+check() {
+  (
+    cd tornado
+    # TODO: exporting PYTHONPATH didn't fix the tornado.speedups not found problem...
+    export PYTHONPATH="$(pwd)/build/lib.linux-$CARCH-3.4:$PYTHONPATH"
+    python -m tornado.test.runtests
+    python -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
+    # python -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver  # pycares not in the repos
+    python -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver
+    python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
+    python -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop
+    python -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop
+    python -m tornado.test.runtests --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver
+  ) || warning "Python 3 tests failed"
+
+  (
+    cd tornado-py2
+    export PYTHONPATH="$(pwd)/build/lib.linux-$CARCH-2.7:$PYTHONPATH"
+    python2 -m tornado.test.runtests
+    python2 -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
+    # python2 -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver  # pycares not in the repos
+    python2 -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver
+    python2 -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop
+    python2 -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop
+    python2 -m tornado.test.runtests --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver
+  ) || warning "Python 2 tests failed"
+}
+
+package_python-tornado() {
+  depends=('python')
+
+  cd tornado
+  python setup.py install --root="${pkgdir}" --optimize=1
+}
+
+package_python2-tornado() {
+  depends=('python2>=2.7.9')
+
+  cd tornado-py2
+  python2 setup.py install --root="${pkgdir}" --optimize=1
+}
+

Copied: python-tornado/repos/community-testing-x86_64/0001-use_system_ca_certificates.patch (from rev 127297, python-tornado/trunk/0001-use_system_ca_certificates.patch)
===================================================================
--- community-testing-x86_64/0001-use_system_ca_certificates.patch	                        (rev 0)
+++ community-testing-x86_64/0001-use_system_ca_certificates.patch	2015-02-08 11:37:38 UTC (rev 127298)
@@ -0,0 +1,57 @@
+diff --git a/setup.py b/setup.py
+index f09169f..d42c486 100644
+--- a/setup.py
++++ b/setup.py
+@@ -120,7 +120,7 @@ if (platform.python_implementation() == 'CPython' and
+ 
+ if setuptools is not None:
+     # If setuptools is not available, you're on your own for dependencies.
+-    install_requires = ['certifi']
++    install_requires = []
+     if sys.version_info < (3, 2):
+         install_requires.append('backports.ssl_match_hostname')
+     kwargs['install_requires'] = install_requires
+diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py
+index f0f73fa..ffe3e40 100644
+--- a/tornado/simple_httpclient.py
++++ b/tornado/simple_httpclient.py
+@@ -33,17 +33,9 @@ except ImportError:
+     # ssl is not available on Google App Engine.
+     ssl = None
+ 
+-try:
+-    import certifi
+-except ImportError:
+-    certifi = None
+-
+ 
+ def _default_ca_certs():
+-    if certifi is None:
+-        raise Exception("The 'certifi' package is required to use https "
+-                        "in simple_httpclient")
+-    return certifi.where()
++    return "/etc/ssl/certs/ca-certificates.crt"
+ 
+ 
+ class SimpleAsyncHTTPClient(AsyncHTTPClient):
+diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py
+index 01b0d95..47a64e7 100644
+--- a/tornado/test/iostream_test.py
++++ b/tornado/test/iostream_test.py
+@@ -10,7 +10,6 @@ from tornado.stack_context import NullContext
+ from tornado.testing import AsyncHTTPTestCase, AsyncHTTPSTestCase, AsyncTestCase, bind_unused_port, ExpectLog, gen_test
+ from tornado.test.util import unittest, skipIfNonUnix
+ from tornado.web import RequestHandler, Application
+-import certifi
+ import errno
+ import logging
+ import os
+@@ -855,7 +854,7 @@ class TestIOStreamStartTLS(AsyncTestCase):
+     def test_handshake_fail(self):
+         self.server_start_tls(_server_ssl_options())
+         client_future = self.client_start_tls(
+-            dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs=certifi.where()))
++            dict(cert_reqs=ssl.CERT_REQUIRED, ca_certs="/etc/ssl/certs/ca-certificates.crt"))
+         with ExpectLog(gen_log, "SSL Error"):
+             with self.assertRaises(ssl.SSLError):
+                 yield client_future

Copied: python-tornado/repos/community-testing-x86_64/0002-get-rid-of-backports-ssl-match-hostname.patch (from rev 127297, python-tornado/trunk/0002-get-rid-of-backports-ssl-match-hostname.patch)
===================================================================
--- community-testing-x86_64/0002-get-rid-of-backports-ssl-match-hostname.patch	                        (rev 0)
+++ community-testing-x86_64/0002-get-rid-of-backports-ssl-match-hostname.patch	2015-02-08 11:37:38 UTC (rev 127298)
@@ -0,0 +1,23 @@
+From f8f2ffca1928aeca2fa9771093436dba49baa538 Mon Sep 17 00:00:00 2001
+From: Felix Yan <felixonmars at gmail.com>
+Date: Fri, 12 Dec 2014 23:10:15 +0800
+Subject: [PATCH] Don't depend on backports.ssl-match-hostname with python
+ >=2.7.9, <3.0
+
+---
+ setup.py               | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index f09169f..f795807 100644
+--- a/setup.py
++++ b/setup.py
+@@ -121,7 +121,7 @@ def build_extension(self, ext):
+ if setuptools is not None:
+     # If setuptools is not available, you're on your own for dependencies.
+     install_requires = []
+-    if sys.version_info < (3, 2):
++    if sys.version_info < (2, 7, 9) or (3, 0) <= sys.version_info < (3, 2):
+         install_requires.append('backports.ssl_match_hostname')
+     kwargs['install_requires'] = install_requires
+ 

Copied: python-tornado/repos/community-testing-x86_64/PKGBUILD (from rev 127297, python-tornado/trunk/PKGBUILD)
===================================================================
--- community-testing-x86_64/PKGBUILD	                        (rev 0)
+++ community-testing-x86_64/PKGBUILD	2015-02-08 11:37:38 UTC (rev 127298)
@@ -0,0 +1,82 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Thomas Dziedzic < gostrc at gmail >
+
+pkgname=('python-tornado' 'python2-tornado')
+pkgver=4.1.0
+pkgrel=1
+pkgdesc='open source version of the scalable, non-blocking web server and tools'
+arch=('i686' 'x86_64')
+url='http://www.tornadoweb.org/'
+license=('Apache')
+makedepends=('python-setuptools' 'python2-setuptools' 'git')
+checkdepends=('python-pycurl' 'python2-pycurl' 'python-mock' 'python2-mock' 'python-twisted' 'python2-twisted' 'python2-futures' 'python2-singledispatch')
+source=("git+https://github.com/facebook/tornado.git#tag=v$pkgver"
+        0001-use_system_ca_certificates.patch
+        0002-get-rid-of-backports-ssl-match-hostname.patch)
+sha512sums=('SKIP'
+            '6e50e9ecf361d54d9f67e1f12185cf58863ad0eae72fbe7cc24e8eaf94874255009a030249bb51adf06e98c7ed0b17d8c6d9ee65190ebc341d6857c0efbc7840'
+            '798f1c5f659138aa4d775edde7c962ec6410671f528b7ec44ca12ac342ddf9ec51d998c676b9025292a58c2140ba8492fcc76759b63adaf08320f96b11bcbfea')
+
+prepare() {
+  cd tornado
+  patch -p1 -i ../0001-use_system_ca_certificates.patch
+  patch -p1 -i ../0002-get-rid-of-backports-ssl-match-hostname.patch
+
+  cd "$srcdir"
+  cp -a tornado{,-py2}
+
+  # python -> python2 rename
+  find tornado-py2 -name '*py' -exec sed -e 's_#!/usr/bin/env python_&2_' -i {} \;
+}
+
+build() {
+  cd tornado
+  python setup.py build
+
+  cd ../tornado-py2
+  python2 setup.py build
+}
+
+check() {
+  (
+    cd tornado
+    # TODO: exporting PYTHONPATH didn't fix the tornado.speedups not found problem...
+    export PYTHONPATH="$(pwd)/build/lib.linux-$CARCH-3.4:$PYTHONPATH"
+    python -m tornado.test.runtests
+    python -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
+    # python -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver  # pycares not in the repos
+    python -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver
+    python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
+    python -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop
+    python -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop
+    python -m tornado.test.runtests --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver
+  ) || warning "Python 3 tests failed"
+
+  (
+    cd tornado-py2
+    export PYTHONPATH="$(pwd)/build/lib.linux-$CARCH-2.7:$PYTHONPATH"
+    python2 -m tornado.test.runtests
+    python2 -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
+    # python2 -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver  # pycares not in the repos
+    python2 -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver
+    python2 -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop
+    python2 -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop
+    python2 -m tornado.test.runtests --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver
+  ) || warning "Python 2 tests failed"
+}
+
+package_python-tornado() {
+  depends=('python')
+
+  cd tornado
+  python setup.py install --root="${pkgdir}" --optimize=1
+}
+
+package_python2-tornado() {
+  depends=('python2>=2.7.9')
+
+  cd tornado-py2
+  python2 setup.py install --root="${pkgdir}" --optimize=1
+}
+



More information about the arch-commits mailing list