python-urllib3: update to 1.9; update unbundling patch.

This commit is contained in:
Alessio Sergi 2014-08-19 02:29:19 +02:00
parent d8092105e5
commit 5883e35a8f
2 changed files with 93 additions and 77 deletions

View file

@ -1,7 +1,16 @@
diff -Nur dev-requirements.txt dev-requirements.txt
--- dev-requirements.txt 2014-07-07 22:56:01.000000000 +0200
+++ dev-requirements.txt 2014-08-19 02:10:38.507546859 +0200
@@ -3,3 +3,5 @@
tornado==3.2.2
coverage==3.7.1
tox==1.7.1
+six
+backports.ssl_match_hostname
diff -Nur dummyserver/handlers.py dummyserver/handlers.py diff -Nur dummyserver/handlers.py dummyserver/handlers.py
--- dummyserver/handlers.py 2014-04-18 07:35:23.000000000 +0200 --- dummyserver/handlers.py 2014-07-07 22:56:01.000000000 +0200
+++ dummyserver/handlers.py 2014-07-04 12:18:35.064230194 +0200 +++ dummyserver/handlers.py 2014-08-19 02:03:31.933539957 +0200
@@ -190,7 +190,7 @@ @@ -211,7 +211,7 @@
""" """
import tornado.httputil import tornado.httputil
import email.utils import email.utils
@ -11,19 +20,19 @@ diff -Nur dummyserver/handlers.py dummyserver/handlers.py
line = line.encode('utf-8') line = line.encode('utf-8')
parts = tornado.httputil._parseparam(';' + line) parts = tornado.httputil._parseparam(';' + line)
diff -Nur setup.py setup.py diff -Nur setup.py setup.py
--- setup.py 2014-06-24 20:19:21.000000000 +0200 --- setup.py 2014-07-07 22:56:01.000000000 +0200
+++ setup.py 2014-07-04 12:18:55.856229523 +0200 +++ setup.py 2014-08-19 01:51:36.502528381 +0200
@@ -45,7 +45,6 @@ @@ -42,7 +42,6 @@
url='http://urllib3.readthedocs.org/', url='http://urllib3.readthedocs.org/',
license='MIT', license='MIT',
packages=['urllib3', packages=['urllib3',
- 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', - 'urllib3.packages', 'urllib3.packages.ssl_match_hostname',
'urllib3.contrib', 'urllib3.util', 'urllib3.contrib', 'urllib3.util',
], ],
requires=requirements, requires=[],
diff -Nur test/test_collections.py test/test_collections.py diff -Nur test/test_collections.py test/test_collections.py
--- test/test_collections.py 2014-03-15 01:05:07.000000000 +0100 --- test/test_collections.py 2014-03-15 01:05:07.000000000 +0100
+++ test/test_collections.py 2014-07-04 12:25:52.942216059 +0200 +++ test/test_collections.py 2014-08-19 01:52:16.527529028 +0200
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
HTTPHeaderDict, HTTPHeaderDict,
RecentlyUsedContainer as Container RecentlyUsedContainer as Container
@ -34,25 +43,23 @@ diff -Nur test/test_collections.py test/test_collections.py
diff -Nur test/test_connectionpool.py test/test_connectionpool.py diff -Nur test/test_connectionpool.py test/test_connectionpool.py
--- test/test_connectionpool.py 2014-03-04 20:08:03.000000000 +0100 --- test/test_connectionpool.py 2014-07-07 22:56:01.000000000 +0200
+++ test/test_connectionpool.py 2014-07-06 19:49:59.995827758 +0200 +++ test/test_connectionpool.py 2014-08-19 01:54:30.020531188 +0200
@@ -6,7 +6,12 @@ @@ -6,7 +6,10 @@
HTTPConnectionPool, HTTPConnectionPool,
) )
from urllib3.util import Timeout from urllib3.util.timeout import Timeout
-from urllib3.packages.ssl_match_hostname import CertificateError -from urllib3.packages.ssl_match_hostname import CertificateError
+try: +try:
+ # python3.2+
+ from ssl import CertificateError + from ssl import CertificateError
+except ImportError: +except ImportError:
+ # Older python where the backport from pypi is installed
+ from backports.ssl_match_hostname import CertificateError + from backports.ssl_match_hostname import CertificateError
from urllib3.exceptions import ( from urllib3.exceptions import (
ClosedPoolError, ClosedPoolError,
EmptyPoolError, EmptyPoolError,
diff -Nur test/test_fields.py test/test_fields.py diff -Nur test/test_fields.py test/test_fields.py
--- test/test_fields.py 2014-03-04 20:08:03.000000000 +0100 --- test/test_fields.py 2014-03-04 20:08:03.000000000 +0100
+++ test/test_fields.py 2014-07-04 12:27:03.632213778 +0200 +++ test/test_fields.py 2014-08-19 01:54:57.941531640 +0200
@@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import unittest import unittest
@ -64,7 +71,7 @@ diff -Nur test/test_fields.py test/test_fields.py
class TestRequestField(unittest.TestCase): class TestRequestField(unittest.TestCase):
diff -Nur test/test_filepost.py test/test_filepost.py diff -Nur test/test_filepost.py test/test_filepost.py
--- test/test_filepost.py 2014-03-15 01:05:07.000000000 +0100 --- test/test_filepost.py 2014-03-15 01:05:07.000000000 +0100
+++ test/test_filepost.py 2014-07-04 12:27:22.673213163 +0200 +++ test/test_filepost.py 2014-08-19 01:55:14.829531913 +0200
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
from urllib3.filepost import encode_multipart_formdata, iter_fields from urllib3.filepost import encode_multipart_formdata, iter_fields
@ -74,19 +81,21 @@ diff -Nur test/test_filepost.py test/test_filepost.py
BOUNDARY = '!! test boundary !!' BOUNDARY = '!! test boundary !!'
diff -Nur test-requirements.txt test-requirements.txt diff -Nur test/test_retry.py test/test_retry.py
--- test-requirements.txt 2014-06-24 20:19:21.000000000 +0200 --- test/test_retry.py 2014-07-07 22:56:01.000000000 +0200
+++ test-requirements.txt 2014-07-06 19:48:14.791831154 +0200 +++ test/test_retry.py 2014-08-19 01:56:07.295532762 +0200
@@ -2,3 +2,5 @@ @@ -1,6 +1,6 @@
mock==1.0.1 import unittest
tornado==3.1.1
coverage==3.6 -from urllib3.packages.six.moves import xrange
+six +from six.moves import xrange
+backports.ssl_match_hostname from urllib3.util.retry import Retry
from urllib3.exceptions import (
ConnectTimeoutError,
diff -Nur urllib3/_collections.py urllib3/_collections.py diff -Nur urllib3/_collections.py urllib3/_collections.py
--- urllib3/_collections.py 2014-06-24 01:44:37.000000000 +0200 --- urllib3/_collections.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/_collections.py 2014-07-04 12:51:43.761166000 +0200 +++ urllib3/_collections.py 2014-08-19 02:07:34.678543884 +0200
@@ -16,11 +16,8 @@ @@ -10,11 +10,8 @@
pass pass
@ -100,48 +109,44 @@ diff -Nur urllib3/_collections.py urllib3/_collections.py
__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict'] __all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict']
diff -Nur urllib3/connectionpool.py urllib3/connectionpool.py
--- urllib3/connectionpool.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/connectionpool.py 2014-08-19 01:57:57.899534552 +0200
@@ -26,8 +26,11 @@
TimeoutError,
InsecureRequestWarning,
)
-from .packages.ssl_match_hostname import CertificateError
-from .packages import six
+try:
+ from ssl import CertificateError
+except ImportError:
+ from backports.ssl_match_hostname import CertificateError
+import six
from .connection import (
port_by_scheme,
DummyConnection,
diff -Nur urllib3/connection.py urllib3/connection.py diff -Nur urllib3/connection.py urllib3/connection.py
--- urllib3/connection.py 2014-06-24 01:44:37.000000000 +0200 --- urllib3/connection.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/connection.py 2014-07-06 19:52:27.263823004 +0200 +++ urllib3/connection.py 2014-08-19 01:59:00.332535562 +0200
@@ -33,8 +33,13 @@ @@ -27,8 +27,11 @@
from .exceptions import ( from .exceptions import (
ConnectTimeoutError, ConnectTimeoutError,
) )
-from .packages.ssl_match_hostname import match_hostname -from .packages.ssl_match_hostname import match_hostname
-from .packages import six -from .packages import six
+try: +try:
+ # python3.2+ + from ssl import match_hostname
+ from ssl import match_hostname, CertificateError
+except ImportError: +except ImportError:
+ # Older python where the backport from pypi is installed + from backports.ssl_match_hostname import match_hostname
+ from backports.ssl_match_hostname import match_hostname, CertificateError
+import six +import six
from .util import (
assert_fingerprint, from .util.ssl_ import (
resolve_cert_reqs, resolve_cert_reqs,
diff -Nur urllib3/connectionpool.py urllib3/connectionpool.py
--- urllib3/connectionpool.py 2014-06-24 01:44:37.000000000 +0200
+++ urllib3/connectionpool.py 2014-07-06 19:51:36.446824644 +0200
@@ -30,8 +30,13 @@
ReadTimeoutError,
ProxyError,
)
-from .packages.ssl_match_hostname import CertificateError
-from .packages import six
+try:
+ # python3.2+
+ from ssl import match_hostname, CertificateError
+except ImportError:
+ # Older python where the backport from pypi is installed
+ from backports.ssl_match_hostname import match_hostname, CertificateError
+import six
from .connection import (
port_by_scheme,
DummyConnection,
diff -Nur urllib3/fields.py urllib3/fields.py diff -Nur urllib3/fields.py urllib3/fields.py
--- urllib3/fields.py 2014-06-24 01:44:37.000000000 +0200 --- urllib3/fields.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/fields.py 2014-07-04 12:31:13.137205724 +0200 +++ urllib3/fields.py 2014-08-19 01:59:25.757535973 +0200
@@ -7,7 +7,7 @@ @@ -1,7 +1,7 @@
import email.utils import email.utils
import mimetypes import mimetypes
@ -151,9 +156,9 @@ diff -Nur urllib3/fields.py urllib3/fields.py
def guess_content_type(filename, default='application/octet-stream'): def guess_content_type(filename, default='application/octet-stream'):
diff -Nur urllib3/filepost.py urllib3/filepost.py diff -Nur urllib3/filepost.py urllib3/filepost.py
--- urllib3/filepost.py 2014-06-24 01:44:37.000000000 +0200 --- urllib3/filepost.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/filepost.py 2014-07-04 12:31:58.762204251 +0200 +++ urllib3/filepost.py 2014-08-19 02:00:05.271536613 +0200
@@ -9,8 +9,8 @@ @@ -3,8 +3,8 @@
from uuid import uuid4 from uuid import uuid4
from io import BytesIO from io import BytesIO
@ -165,25 +170,37 @@ diff -Nur urllib3/filepost.py urllib3/filepost.py
writer = codecs.lookup('utf-8')[3] writer = codecs.lookup('utf-8')[3]
diff -Nur urllib3/response.py urllib3/response.py diff -Nur urllib3/response.py urllib3/response.py
--- urllib3/response.py 2014-06-24 01:44:37.000000000 +0200 --- urllib3/response.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/response.py 2014-07-04 12:32:18.507203614 +0200 +++ urllib3/response.py 2014-08-19 02:00:38.448537150 +0200
@@ -11,7 +11,7 @@ @@ -4,7 +4,7 @@
from ._collections import HTTPHeaderDict from ._collections import HTTPHeaderDict
from .exceptions import DecodeError, ReadTimeoutError from .exceptions import ProtocolError, DecodeError, ReadTimeoutError
-from .packages.six import string_types as basestring, binary_type -from .packages.six import string_types as basestring, binary_type
+from six import string_types as basestring, binary_type +from six import string_types as basestring, binary_type
from .util import is_fp_closed from .connection import HTTPException, BaseSSLError
from .util.response import is_fp_closed
diff -Nur urllib3/util/request.py urllib3/util/request.py diff -Nur urllib3/util/request.py urllib3/util/request.py
--- urllib3/util/request.py 2014-06-24 01:44:37.000000000 +0200 --- urllib3/util/request.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/util/request.py 2014-07-04 12:29:20.645209355 +0200 +++ urllib3/util/request.py 2014-08-19 02:00:57.616537460 +0200
@@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
from base64 import b64encode from base64 import b64encode
-from ..packages.six import b
+from six import b
ACCEPT_ENCODING = 'gzip,deflate'
diff -Nur urllib3/util/retry.py urllib3/util/retry.py
--- urllib3/util/retry.py 2014-07-07 22:56:01.000000000 +0200
+++ urllib3/util/retry.py 2014-08-19 02:01:18.385537796 +0200
@@ -7,7 +7,7 @@
ReadTimeoutError,
MaxRetryError,
)
-from ..packages import six -from ..packages import six
+import six +import six
ACCEPT_ENCODING = 'gzip,deflate' log = logging.getLogger(__name__)

View file

@ -1,22 +1,21 @@
# Template file for 'python-urllib3' # Template file for 'python-urllib3'
pkgname=python-urllib3 pkgname=python-urllib3
version=1.8.3 version=1.9
revision=1 revision=1
noarch=yes noarch=yes
wrksrc="${pkgname#*-}-${version}" wrksrc="${pkgname#*-}-${version}"
build_style="python-module" build_style="python-module"
python_versions="2.7 3.4" python_versions="2.7 3.4"
hostmakedepends="python-devel python3.4-devel" hostmakedepends="python-setuptools python3.4-setuptools"
makedepends="${hostmakedepends} python-backports-ssl-match-hostname makedepends="python-backports-ssl-match-hostname python-six python3.4-six"
python-six python3.4-six"
depends="python python-backports-ssl-match-hostname python-six ca-certificates" depends="python python-backports-ssl-match-hostname python-six ca-certificates"
pycompile_module="urllib3" pycompile_module="urllib3"
short_desc="HTTP library with thread-safe connection pooling (Python2)" short_desc="HTTP library with thread-safe connection pooling (Python2)"
maintainer="Alessio Sergi <al3hex@gmail.com>" maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://github.com/shazow/urllib3" homepage="https://github.com/shazow/urllib3"
license="MIT" license="MIT"
distfiles="https://pypi.python.org/packages/source/u/${pkgname#*-}/${pkgname#*-}-${version}.tar.gz" distfiles="https://pypi.python.org/packages/source/u/urllib3/urllib3-${version}.tar.gz"
checksum=4b162cffb6c7dde47b47ecee741f8a00953512541241e61d0f8292107a865426 checksum=4e400b2e2f53652dd0d8062ca5ecc425b6af6e96989b8d31f5dd875186aa247b
python3.4-urllib3_package() { python3.4-urllib3_package() {
noarch=yes noarch=yes