14
0

Accepting request 622952 from devel:languages:python

- update to 1.23
- add 1414.patch - fix tests with new tornado
- refresh python-urllib3-recent-date.patch
- drop urllib3-test-no-coverage.patch
 * Allow providing a list of headers to strip from requests when redirecting 
   to a different host. Defaults to the Authorization header. Different
   headers can be set via Retry.remove_headers_on_redirect.
 * Fix util.selectors._fileobj_to_fd to accept long
 * Dropped Python 3.3 support.
 * Put the connection back in the pool when calling stream()
   or read_chunked() on a chunked HEAD response.
 * Fixed pyOpenSSL-specific ssl client authentication issue when clients
   attempted to auth via certificate + chain
 * Add the port to the connectionpool connect print
 * Don't use the uuid module to create multipart data boundaries.
 * read_chunked() on a closed response returns no chunks.
 * Add Python 2.6 support to contrib.securetransport
 * Added support for auth info in url for SOCKS proxy (forwarded request 622951 from mimi_vx)

OBS-URL: https://build.opensuse.org/request/show/622952
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-urllib3?expand=0&rev=18
This commit is contained in:
2018-07-17 07:38:01 +00:00
committed by Git OBS Bridge
7 changed files with 134 additions and 47 deletions

83
1414.patch Normal file
View File

@@ -0,0 +1,83 @@
From f8c3e96df731eccda202e0dc909f0a51cdc41267 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sat, 14 Jul 2018 12:21:50 +0200
Subject: [PATCH 1/2] dummyserver: Update for tornado-5 API changes
Tornado 5 has apparently removed support for multiple IOLoops,
and appropriately removed the io_loop parameter to the server class
in favor of using IOLoop.current(). Update the tests to use the latter.
The code remains compatible with tornado-4.
---
dummyserver/server.py | 9 +++++----
dummyserver/testcase.py | 4 ++--
2 files changed, 7 insertions(+), 6 deletions(-)
Index: urllib3-1.23/dummyserver/server.py
===================================================================
--- urllib3-1.23.orig/dummyserver/server.py
+++ urllib3-1.23/dummyserver/server.py
@@ -226,15 +226,16 @@ def bind_sockets(port, address=None, fam
def run_tornado_app(app, io_loop, certs, scheme, host):
+ assert io_loop == tornado.ioloop.IOLoop.current()
+
# We can't use fromtimestamp(0) because of CPython issue 29097, so we'll
# just construct the datetime object directly.
app.last_req = datetime(1970, 1, 1)
if scheme == 'https':
- http_server = tornado.httpserver.HTTPServer(app, ssl_options=certs,
- io_loop=io_loop)
+ http_server = tornado.httpserver.HTTPServer(app, ssl_options=certs)
else:
- http_server = tornado.httpserver.HTTPServer(app, io_loop=io_loop)
+ http_server = tornado.httpserver.HTTPServer(app)
sockets = bind_sockets(None, address=host)
port = sockets[0].getsockname()[1]
@@ -268,7 +269,7 @@ if __name__ == '__main__':
from .testcase import TestingApp
host = '127.0.0.1'
- io_loop = tornado.ioloop.IOLoop()
+ io_loop = tornado.ioloop.IOLoop.current()
app = tornado.web.Application([(r".*", TestingApp)])
server, port = run_tornado_app(app, io_loop, None,
'http', host)
Index: urllib3-1.23/dummyserver/testcase.py
===================================================================
--- urllib3-1.23.orig/dummyserver/testcase.py
+++ urllib3-1.23/dummyserver/testcase.py
@@ -124,7 +124,7 @@ class HTTPDummyServerTestCase(unittest.T
@classmethod
def _start_server(cls):
- cls.io_loop = ioloop.IOLoop()
+ cls.io_loop = ioloop.IOLoop.current()
app = web.Application([(r".*", TestingApp)])
cls.server, cls.port = run_tornado_app(app, cls.io_loop, cls.certs,
cls.scheme, cls.host)
@@ -170,7 +170,7 @@ class HTTPDummyProxyTestCase(unittest.Te
@classmethod
def setUpClass(cls):
- cls.io_loop = ioloop.IOLoop()
+ cls.io_loop = ioloop.IOLoop.current()
app = web.Application([(r'.*', TestingApp)])
cls.http_server, cls.http_port = run_tornado_app(
Index: urllib3-1.23/dev-requirements.txt
===================================================================
--- urllib3-1.23.orig/dev-requirements.txt
+++ urllib3-1.23/dev-requirements.txt
@@ -3,7 +3,8 @@ coverage==3.7.1
tox==2.1.1
twine==1.5.0
wheel==0.24.0
-tornado==4.2.1
+tornado==5.0.2; python_version>"2.6"
+tornado==4.2.1; python_version<="2.6"
PySocks==1.5.6
pkginfo>=1.0,!=1.3.0
psutil==4.3.1

View File

@@ -13,23 +13,16 @@ Fixes #1303
urllib3/connection.py | 6 +++--- urllib3/connection.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-) 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/urllib3/connection.py b/urllib3/connection.py Index: urllib3-1.23/urllib3/connection.py
index 06bcbde..9ea04bb 100644 ===================================================================
--- a/urllib3/connection.py --- urllib3-1.23.orig/urllib3/connection.py
+++ b/urllib3/connection.py +++ urllib3-1.23/urllib3/connection.py
@@ -57,9 +57,9 @@ port_by_scheme = { @@ -60,7 +60,7 @@ port_by_scheme = {
} # and not less than 6 months ago.
# Example: if Today is 2018-01-01, then RECENT_DATE should be any date on or
# When updating RECENT_DATE, move it to # after 2016-01-01 (today - 2 years) AND before 2017-07-01 (today - 6 months)
-# within two years of the current date, and no -RECENT_DATE = datetime.date(2017, 6, 30)
-# earlier than 6 months ago. +RECENT_DATE = datetime.date(2018, 1, 30)
-RECENT_DATE = datetime.date(2016, 1, 1)
+# within two years of the current date, and not
+# less than 6 months ago.
+RECENT_DATE = datetime.date(2017, 6, 30)
class DummyConnection(object): class DummyConnection(object):
--
2.15.1

View File

@@ -1,3 +1,25 @@
-------------------------------------------------------------------
Sun Jul 15 22:30:26 UTC 2018 - mimi.vx@gmail.com
- update to 1.23
- add 1414.patch - fix tests with new tornado
- refresh python-urllib3-recent-date.patch
- drop urllib3-test-no-coverage.patch
* Allow providing a list of headers to strip from requests when redirecting
to a different host. Defaults to the Authorization header. Different
headers can be set via Retry.remove_headers_on_redirect.
* Fix util.selectors._fileobj_to_fd to accept long
* Dropped Python 3.3 support.
* Put the connection back in the pool when calling stream()
or read_chunked() on a chunked HEAD response.
* Fixed pyOpenSSL-specific ssl client authentication issue when clients
attempted to auth via certificate + chain
* Add the port to the connectionpool connect print
* Don't use the uuid module to create multipart data boundaries.
* read_chunked() on a closed response returns no chunks.
* Add Python 2.6 support to contrib.securetransport
* Added support for auth info in url for SOCKS proxy
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 7 15:52:54 UTC 2018 - aplanas@suse.com Wed Mar 7 15:52:54 UTC 2018 - aplanas@suse.com

View File

@@ -18,15 +18,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-urllib3 Name: python-urllib3
Version: 1.22 Version: 1.23
Release: 0 Release: 0
Summary: HTTP library with thread-safe connection pooling, file post, and more Summary: HTTP library with thread-safe connection pooling, file post, and more
License: MIT License: MIT
Group: Development/Languages/Python Group: Development/Languages/Python
Url: http://urllib3.readthedocs.org/ URL: http://urllib3.readthedocs.org/
Source: https://files.pythonhosted.org/packages/source/u/urllib3/urllib3-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/u/urllib3/urllib3-%{version}.tar.gz
# PATCH-FIX-OPENSUSE speilicke@suse.com -- We need no coverage report # PATCH-FIX-UPSTREAM -- tornado 5.x support for tests
Patch1: urllib3-test-no-coverage.patch Patch1: 1414.patch
# PATCH-FEATURE-UPSTREAM -- use set_default_verify_paths() if no certificate path is supplied # PATCH-FEATURE-UPSTREAM -- use set_default_verify_paths() if no certificate path is supplied
# should be removed in the future, see SR#437853 # should be removed in the future, see SR#437853
Patch2: urllib3-ssl-default-context.patch Patch2: urllib3-ssl-default-context.patch
@@ -34,8 +34,6 @@ Patch2: urllib3-ssl-default-context.patch
Patch3: urllib3-test-ssl-drop-sslv3.patch Patch3: urllib3-test-ssl-drop-sslv3.patch
# PATCH-FIX-UPSTREAM python-urllib3-recent-date.patch gh#shazow/urllib3#1303, boo#1074247 dimstar@opensuse.org -- Fix test suite, use correct date # PATCH-FIX-UPSTREAM python-urllib3-recent-date.patch gh#shazow/urllib3#1303, boo#1074247 dimstar@opensuse.org -- Fix test suite, use correct date
Patch4: python-urllib3-recent-date.patch Patch4: python-urllib3-recent-date.patch
BuildRequires: python-rpm-macros
#!BuildIgnore: python-requests
BuildRequires: %{python_module PySocks} BuildRequires: %{python_module PySocks}
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
BuildRequires: %{python_module mock >= 1.3.0} BuildRequires: %{python_module mock >= 1.3.0}
@@ -43,15 +41,17 @@ BuildRequires: %{python_module nose >= 1.3.7}
BuildRequires: %{python_module psutil} BuildRequires: %{python_module psutil}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module tornado >= 4.2.1} BuildRequires: %{python_module tornado >= 4.2.1}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
#!BuildIgnore: python-requests
BuildArch: noarch
%if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24 %if 0%{?suse_version} >= 1000 || 0%{?fedora_version} >= 24
Recommends: python-pyOpenSSL Recommends: ca-certificates-mozilla
Recommends: python-cryptography Recommends: python-cryptography
Recommends: python-idna Recommends: python-idna
Recommends: python-ndg-httpsclient Recommends: python-ndg-httpsclient
Recommends: ca-certificates-mozilla Recommends: python-pyOpenSSL
%endif %endif
BuildArch: noarch
%python_subpackages %python_subpackages
%description %description
@@ -78,16 +78,18 @@ Highlights
%patch3 -p1 %patch3 -p1
%endif %endif
%patch4 -p1 %patch4 -p1
find . -type f -exec chmod a-x '{}' \;
%build %build
%python_build %python_build
%install %install
%python_install %python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
skiplist='not test_select_interrupt_exception and not test_selector_error and not timeout' skiplist='not test_select_interrupt_exception and not test_selector_error and not timeout and not test_request_host_header_ignores_fqdn_dot and not test_dotted_fqdn'
case $(uname -m) in case $(uname -m) in
ppc*) ppc*)
skiplist="$skiplist and not test_select_timing and not test_select_multiple_interrupts_with_event and not test_interrupt_wait_for_read_with_event and not test_select_interrupt_with_event";; skiplist="$skiplist and not test_select_timing and not test_select_multiple_interrupts_with_event and not test_interrupt_wait_for_read_with_event and not test_select_interrupt_with_event";;
@@ -96,7 +98,7 @@ esac
rm -rf build rm -rf build
# pretend to be TRAVIS (this triggers timing tolerance) # pretend to be TRAVIS (this triggers timing tolerance)
export TRAVIS=1 export TRAVIS=1
%{python_expand PYTHONPATH="%{buildroot}%{$python_sitelib}" py.test \ %{python_expand PYTHONPATH="%{buildroot}%{$python_sitelib}" py.test-%$python_bin_suffix \
--ignore=test/appengine \ --ignore=test/appengine \
--ignore=test/with_dummyserver/test_proxy_poolmanager.py \ --ignore=test/with_dummyserver/test_proxy_poolmanager.py \
--ignore=test/with_dummyserver/test_poolmanager.py \ --ignore=test/with_dummyserver/test_poolmanager.py \
@@ -104,8 +106,8 @@ export TRAVIS=1
urllib3 test} urllib3 test}
%files %{python_files} %files %{python_files}
%defattr(-,root,root,-) %license LICENSE.txt
%doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst %doc CHANGES.rst CONTRIBUTORS.txt README.rst
%{python_sitelib}/urllib3 %{python_sitelib}/urllib3
%{python_sitelib}/urllib3-%{version}-py*.egg-info %{python_sitelib}/urllib3-%{version}-py*.egg-info

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f
size 226083

3
urllib3-1.23.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf
size 228314

View File

@@ -1,13 +0,0 @@
Index: urllib3-1.21.1/setup.cfg
===================================================================
--- urllib3-1.21.1.orig/setup.cfg
+++ urllib3-1.21.1/setup.cfg
@@ -1,8 +1,5 @@
[nosetests]
logging-clear-handlers = true
-with-coverage = true
-cover-package = urllib3
-cover-erase = true
[flake8]
exclude = ./docs/conf.py,./urllib3/packages/*