[arch-commits] Commit in python-tornado/trunk (4 files)

Felix Yan fyan at archlinux.org
Tue Dec 16 04:00:24 UTC 2014


    Date: Tuesday, December 16, 2014 @ 05:00:24
  Author: fyan
Revision: 123935

upgpkg: python-tornado 4.0.2-2

use python2 2.7.9's new ssl library instead of backports.ssl-match-hostname

Added:
  python-tornado/trunk/0001-use_system_ca_certificates.patch
    (from rev 123837, python-tornado/trunk/use_system_ca_certificates.patch)
  python-tornado/trunk/0002-get-rid-of-backports-ssl-match-hostname.patch
Modified:
  python-tornado/trunk/PKGBUILD
Deleted:
  python-tornado/trunk/use_system_ca_certificates.patch

----------------------------------------------------+
 0001-use_system_ca_certificates.patch              |   57 +++++++++++++++++++
 0002-get-rid-of-backports-ssl-match-hostname.patch |   23 +++++++
 PKGBUILD                                           |   19 ++++--
 use_system_ca_certificates.patch                   |   57 -------------------
 4 files changed, 92 insertions(+), 64 deletions(-)

Copied: python-tornado/trunk/0001-use_system_ca_certificates.patch (from rev 123837, python-tornado/trunk/use_system_ca_certificates.patch)
===================================================================
--- 0001-use_system_ca_certificates.patch	                        (rev 0)
+++ 0001-use_system_ca_certificates.patch	2014-12-16 04:00:24 UTC (rev 123935)
@@ -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

Added: 0002-get-rid-of-backports-ssl-match-hostname.patch
===================================================================
--- 0002-get-rid-of-backports-ssl-match-hostname.patch	                        (rev 0)
+++ 0002-get-rid-of-backports-ssl-match-hostname.patch	2014-12-16 04:00:24 UTC (rev 123935)
@@ -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
+ 

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-12-16 01:32:38 UTC (rev 123934)
+++ PKGBUILD	2014-12-16 04:00:24 UTC (rev 123935)
@@ -1,24 +1,27 @@
 # $Id$
-# Maintainer: Felix Yan <felixonmars at gmail.com>
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
 # Contributor: Thomas Dziedzic < gostrc at gmail >
 
 pkgname=('python-tornado' 'python2-tornado')
 pkgver=4.0.2
-pkgrel=1
+pkgrel=2
 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' 'python2-backports.ssl_match_hostname' 'git')
+makedepends=('python-setuptools' 'python2-setuptools' 'git')
 checkdepends=('python-pycurl' 'python2-pycurl' 'python-mock' 'python2-mock' 'python-twisted' 'python2-twisted')
 source=("git+https://github.com/facebook/tornado.git#tag=v$pkgver"
-        use_system_ca_certificates.patch)
+        0001-use_system_ca_certificates.patch
+        0002-get-rid-of-backports-ssl-match-hostname.patch)
 sha512sums=('SKIP'
-            '6e50e9ecf361d54d9f67e1f12185cf58863ad0eae72fbe7cc24e8eaf94874255009a030249bb51adf06e98c7ed0b17d8c6d9ee65190ebc341d6857c0efbc7840')
+            '6e50e9ecf361d54d9f67e1f12185cf58863ad0eae72fbe7cc24e8eaf94874255009a030249bb51adf06e98c7ed0b17d8c6d9ee65190ebc341d6857c0efbc7840'
+            '798f1c5f659138aa4d775edde7c962ec6410671f528b7ec44ca12ac342ddf9ec51d998c676b9025292a58c2140ba8492fcc76759b63adaf08320f96b11bcbfea')
 
 prepare() {
   cd tornado
-  patch -p1 -i ../use_system_ca_certificates.patch
+  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}
@@ -49,12 +52,14 @@
 }
 
 package_python-tornado() {
+  depends=('python')
+
   cd tornado
   python setup.py install --root="${pkgdir}" --optimize=1
 }
 
 package_python2-tornado() {
-  depends=('python2-backports.ssl_match_hostname')
+  depends=('python2>=2.7.9')
 
   cd tornado-py2
   python2 setup.py install --root="${pkgdir}" --optimize=1

Deleted: use_system_ca_certificates.patch
===================================================================
--- use_system_ca_certificates.patch	2014-12-16 01:32:38 UTC (rev 123934)
+++ use_system_ca_certificates.patch	2014-12-16 04:00:24 UTC (rev 123935)
@@ -1,57 +0,0 @@
-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



More information about the arch-commits mailing list