diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 16 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/patches/01_do-not-use-embedded-python-six.patch | 34 | ||||
-rw-r--r-- | debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch | 8 | ||||
-rw-r--r-- | debian/patches/06_add-test-init-py.patch | 99 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rwxr-xr-x | debian/rules | 3 |
7 files changed, 50 insertions, 113 deletions
diff --git a/debian/changelog b/debian/changelog index 93324ca..f5c8db8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +python-urllib3 (1.9.1-1) unstable; urgency=medium + + * New upstream release. + * debian/control + - Bump Standards-Version to 3.9.6 (no changes needed). + * debian/patches/01_do-not-use-embedded-python-six.patch + - Refresh. + * debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch + - Refresh. + * debian/patches/06_add-test-init-py.patch + - Remove since fixed upstream. + * debian/rules + - Exclude with_dummyserver tests since they are also failing upstream. + + -- Daniele Tricoli <eriol@mornie.org> Tue, 23 Sep 2014 04:28:42 +0200 + python-urllib3 (1.9-1) unstable; urgency=medium * New upstream release diff --git a/debian/control b/debian/control index d11c0b3..c7bb9bb 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Build-Depends: python3-setuptools, python3-six, python3-wheel, -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 X-Python-Version: >= 2.6 X-Python3-Version: >= 3.0 Homepage: http://urllib3.readthedocs.org diff --git a/debian/patches/01_do-not-use-embedded-python-six.patch b/debian/patches/01_do-not-use-embedded-python-six.patch index 0774786..a7a0716 100644 --- a/debian/patches/01_do-not-use-embedded-python-six.patch +++ b/debian/patches/01_do-not-use-embedded-python-six.patch @@ -1,7 +1,7 @@ Description: Do not use embedded copy of python-six. Author: Daniele Tricoli <eriol@mornie.org> Forwarded: not-needed -Last-Update: 2014-09-01 +Last-Update: 2014-09-23 --- a/test/test_collections.py +++ b/test/test_collections.py @@ -106,15 +106,15 @@ Last-Update: 2014-09-01 __all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict'] --- a/urllib3/connection.py +++ b/urllib3/connection.py -@@ -28,7 +28,7 @@ - ConnectTimeoutError, - ) - from .packages.ssl_match_hostname import match_hostname +@@ -3,7 +3,7 @@ + import socket + from socket import timeout as SocketTimeout + import warnings -from .packages import six +import six - from .util.ssl_ import ( - resolve_cert_reqs, + try: # Python 3 + from http.client import HTTPConnection as _HTTPConnection, HTTPException --- a/urllib3/util/request.py +++ b/urllib3/util/request.py @@ -1,6 +1,6 @@ @@ -146,3 +146,23 @@ Last-Update: 2014-09-01 from urllib3.util.retry import Retry from urllib3.exceptions import ( ConnectTimeoutError, +--- a/test/__init__.py ++++ b/test/__init__.py +@@ -7,7 +7,7 @@ + from nose.plugins.skip import SkipTest + + from urllib3.exceptions import MaxRetryError, HTTPWarning +-from urllib3.packages import six ++import six + + # We need a host that will not immediately close the connection with a TCP + # Reset. SO suggests this hostname +--- a/test/contrib/test_pyopenssl.py ++++ b/test/contrib/test_pyopenssl.py +@@ -1,5 +1,5 @@ + from nose.plugins.skip import SkipTest +-from urllib3.packages import six ++import six + + if six.PY3: + raise SkipTest('Testing of PyOpenSSL disabled on PY3') diff --git a/debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch b/debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch index 17c858d..b58f31d 100644 --- a/debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch +++ b/debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch @@ -1,7 +1,7 @@ Description: Do not use embedded copy of ssl.match_hostname. Author: Daniele Tricoli <eriol@mornie.org> Forwarded: not-needed -Last-Update: 2014-09-01 +Last-Update: 2014-09-23 --- a/test/test_connectionpool.py +++ b/test/test_connectionpool.py @@ -16,15 +16,15 @@ Last-Update: 2014-09-01 EmptyPoolError, --- a/urllib3/connection.py +++ b/urllib3/connection.py -@@ -27,7 +27,7 @@ - from .exceptions import ( +@@ -39,7 +39,7 @@ ConnectTimeoutError, + SystemTimeWarning, ) -from .packages.ssl_match_hostname import match_hostname +from ssl import match_hostname - import six from .util.ssl_ import ( + resolve_cert_reqs, --- a/urllib3/connectionpool.py +++ b/urllib3/connectionpool.py @@ -26,7 +26,7 @@ diff --git a/debian/patches/06_add-test-init-py.patch b/debian/patches/06_add-test-init-py.patch deleted file mode 100644 index 2cbbc02..0000000 --- a/debian/patches/06_add-test-init-py.patch +++ /dev/null @@ -1,99 +0,0 @@ -Description: Add needed test/__init__.py file not shipped in sdist. -Origin: https://raw.githubusercontent.com/shazow/urllib3/1.9/test/__init__.py -Bug: https://github.com/shazow/urllib3/issues/440 - ---- /dev/null -+++ b/test/__init__.py -@@ -0,0 +1,92 @@ -+import warnings -+import sys -+import errno -+import functools -+import socket -+ -+from nose.plugins.skip import SkipTest -+ -+from urllib3.exceptions import MaxRetryError, HTTPWarning -+import six -+ -+# We need a host that will not immediately close the connection with a TCP -+# Reset. SO suggests this hostname -+TARPIT_HOST = '10.255.255.1' -+ -+VALID_SOURCE_ADDRESSES = [('::1', 0), ('127.0.0.1', 0)] -+# RFC 5737: 192.0.2.0/24 is for testing only. -+# RFC 3849: 2001:db8::/32 is for documentation only. -+INVALID_SOURCE_ADDRESSES = [('192.0.2.255', 0), ('2001:db8::1', 0)] -+ -+ -+def clear_warnings(cls=HTTPWarning): -+ new_filters = [] -+ for f in warnings.filters: -+ if issubclass(f[2], cls): -+ continue -+ new_filters.append(f) -+ warnings.filters[:] = new_filters -+ -+def setUp(): -+ clear_warnings() -+ warnings.simplefilter('ignore', HTTPWarning) -+ -+ -+def onlyPy26OrOlder(test): -+ """Skips this test unless you are on Python2.6.x or earlier.""" -+ -+ @functools.wraps(test) -+ def wrapper(*args, **kwargs): -+ msg = "{name} only runs on Python2.6.x or older".format(name=test.__name__) -+ if sys.version_info >= (2, 7): -+ raise SkipTest(msg) -+ return test(*args, **kwargs) -+ return wrapper -+ -+def onlyPy27OrNewer(test): -+ """Skips this test unless you are on Python 2.7.x or later.""" -+ -+ @functools.wraps(test) -+ def wrapper(*args, **kwargs): -+ msg = "{name} requires Python 2.7.x+ to run".format(name=test.__name__) -+ if sys.version_info < (2, 7): -+ raise SkipTest(msg) -+ return test(*args, **kwargs) -+ return wrapper -+ -+def onlyPy3(test): -+ """Skips this test unless you are on Python3.x""" -+ -+ @functools.wraps(test) -+ def wrapper(*args, **kwargs): -+ msg = "{name} requires Python3.x to run".format(name=test.__name__) -+ if not six.PY3: -+ raise SkipTest(msg) -+ return test(*args, **kwargs) -+ return wrapper -+ -+def requires_network(test): -+ """Helps you skip tests that require the network""" -+ -+ def _is_unreachable_err(err): -+ return getattr(err, 'errno', None) in (errno.ENETUNREACH, -+ errno.EHOSTUNREACH) # For OSX -+ -+ @functools.wraps(test) -+ def wrapper(*args, **kwargs): -+ msg = "Can't run {name} because the network is unreachable".format( -+ name=test.__name__) -+ try: -+ return test(*args, **kwargs) -+ except socket.error as e: -+ # This test needs an initial network connection to attempt the -+ # connection to the TARPIT_HOST. This fails if you are in a place -+ # without an Internet connection, so we skip the test in that case. -+ if _is_unreachable_err(e): -+ raise SkipTest(msg) -+ raise -+ except MaxRetryError as e: -+ if _is_unreachable_err(e.reason): -+ raise SkipTest(msg) -+ raise -+ return wrapper diff --git a/debian/patches/series b/debian/patches/series index f8be250..cddf757 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,4 +3,3 @@ 03_force_setuptools.patch 04_relax_nosetests_options.patch 05_do-not-use-embedded-ssl-match-hostname.patch -06_add-test-init-py.patch diff --git a/debian/rules b/debian/rules index e66f170..e94c934 100755 --- a/debian/rules +++ b/debian/rules @@ -16,8 +16,9 @@ override_dh_auto_install: -d $(CURDIR)/debian/tmp/usr/share/python-wheels override_dh_auto_test: + # Exclude dummyserver tests since they are also failing upstream. PYBUILD_SYSTEM=custom \ - PYBUILD_TEST_ARGS="cd {build_dir}; {interpreter} -m nose {dir}/test --with-coverage" dh_auto_test + PYBUILD_TEST_ARGS="cd {build_dir}; {interpreter} -m nose {dir}/test --with-coverage -e with_dummyserver" dh_auto_test # Clean here .coverage because it is created by nose using the coverage # plugin find . -name .coverage -delete |