[packages/python-urllib3] - updated to 1.25.9 - updated mock patch - added httplib patch (fix python3 tests: httplib has been

qboosh qboosh at pld-linux.org
Mon Jun 8 16:23:21 CEST 2020


commit f5006321ca8bf71b8bbe8b6073712fd75f87a7e9
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Jun 8 16:24:12 2020 +0200

    - updated to 1.25.9
    - updated mock patch
    - added httplib patch (fix python3 tests: httplib has been renamed to http.client)

 python-urllib3-httplib.patch |  14 +++++
 python-urllib3-mock.patch    | 146 +++++++++++++++++++++++++++++++++++++++++++
 python-urllib3.spec          |  47 ++++++++++----
 3 files changed, 195 insertions(+), 12 deletions(-)
---
diff --git a/python-urllib3.spec b/python-urllib3.spec
index fae8ee9..a6ebe47 100644
--- a/python-urllib3.spec
+++ b/python-urllib3.spec
@@ -4,40 +4,51 @@
 %bcond_without	python2	# CPython 2.x module
 %bcond_without	python3	# CPython 3.x module
 %bcond_without	doc	# Sphinx documentation
-%bcond_with	tests	# test target (uses network etc.)
+%bcond_with	tests	# test target (uses network etc., few failures)
 
 %define		module		urllib3
 Summary:	HTTP library with thread-safe connection pooling, file post, and more
 Summary(pl.UTF-8):	Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
 Name:		python-%{module}
-Version:	1.25.7
+Version:	1.25.9
 Release:	1
 License:	MIT
 Group:		Development/Languages/Python
 #Source0Download: https://pypi.org/simple/urllib3/
 Source0:	https://files.pythonhosted.org/packages/source/u/urllib3/%{module}-%{version}.tar.gz
-# Source0-md5:	85e1e3925f8c1095172bff343f3312ed
+# Source0-md5:	dbf9b868b90880b24b1ac278094e912e
 Patch0:		%{name}-mock.patch
+Patch1:		%{name}-httplib.patch
 URL:		http://urllib3.readthedocs.org/
+%if %(locale -a | grep -q '^C\.utf8$'; echo $?)
+BuildRequires:	glibc-localedb-all
+%endif
 %if %{with python2}
 BuildRequires:	python-modules >= 1:2.7
 %if %{with tests}
 BuildRequires:	python-PySocks >= 1.5.6
 BuildRequires:	python-PySocks < 2.0
-BuildRequires:	python-mock
-BuildRequires:	python-nose
-BuildRequires:	python-tornado
+BuildRequires:	python-cryptography >= 2.8
+# TODO
+#BuildRequires:	python-gcp_devrel-py-tools >= 0.0.15
+BuildRequires:	python-mock >= 3.0.5
+BuildRequires:	python-pytest
+BuildRequires:	python-tornado >= 5.1.1
+BuildRequires:	python-trustme >= 0.5.3
 # SO_REUSEPORT option
 BuildRequires:	uname(release) >= 3.9
 %endif
 %endif
 %if %{with python3}
-BuildRequires:	python3-modules >= 1:3.4
+BuildRequires:	python3-modules >= 1:3.5
 %if %{with tests}
 BuildRequires:	python3-PySocks >= 1.5.6
 BuildRequires:	python3-PySocks < 2.0
-BuildRequires:	python3-nose
-BuildRequires:	python3-tornado
+BuildRequires:	python3-cryptography >= 2.8
+#BuildRequires:	python3-gcp_devrel-py-tools >= 0.0.15
+BuildRequires:	python3-pytest
+BuildRequires:	python3-tornado >= 6.0.3
+BuildRequires:	python3-trustme >= 0.5.3
 # SO_REUSEPORT option
 BuildRequires:	uname(release) >= 3.9
 %endif
@@ -76,7 +87,7 @@ plików metodą POST. Możliwości:
 Summary:	HTTP library with thread-safe connection pooling, file post, and more
 Summary(pl.UTF-8):	Biblioteka HTTP z bezpieczną wątkowo pulą połączeń, wysyłaniem plików itd.
 Group:		Development/Languages/Python
-Requires:	python3-modules >= 1:3.4
+Requires:	python3-modules >= 1:3.5
 
 %description -n python3-urllib3
 Python 3 HTTP module with connection pooling and file POST abilities.
@@ -112,14 +123,26 @@ Dokumentacja API modułu Pythona urllib3.
 %prep
 %setup -q -n %{module}-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests_py2}
+LC_ALL=C.UTF-8 \
+PYTHONPATH=$(pwd)/src \
+%{__python} -m pytest test
+%endif
 %endif
 
 %if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/src \
+%{__python3} -m pytest test
+%endif
 %endif
 
 %if %{with doc}
diff --git a/python-urllib3-httplib.patch b/python-urllib3-httplib.patch
new file mode 100644
index 0000000..8347bfb
--- /dev/null
+++ b/python-urllib3-httplib.patch
@@ -0,0 +1,14 @@
+--- urllib3-1.25.9/test/appengine/test_urlfetch.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/appengine/test_urlfetch.py	2020-06-08 06:18:42.266288014 +0200
+@@ -2,7 +2,10 @@
+ App Engine sandbox enabled that urllib3 appropriately uses the App
+ Engine-patched version of httplib to make requests."""
+ 
+-import httplib
++try:
++    import httplib
++except ImportError:
++    import http.client as httplib
+ import StringIO
+ 
+ from mock import patch
diff --git a/python-urllib3-mock.patch b/python-urllib3-mock.patch
index b869893..d739a3e 100644
--- a/python-urllib3-mock.patch
+++ b/python-urllib3-mock.patch
@@ -12,3 +12,149 @@
  
  
  class MockModule(mock.Mock):
+--- urllib3-1.25.9/test/test_connection.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/test_connection.py	2020-06-07 22:20:50.841614447 +0200
+@@ -1,5 +1,8 @@
+ import datetime
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ import pytest
+ 
+--- urllib3-1.25.9/test/test_queue_monkeypatch.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/test_queue_monkeypatch.py	2020-06-07 22:31:23.954851245 +0200
+@@ -1,6 +1,9 @@
+ from __future__ import absolute_import
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ import pytest
+ 
+--- urllib3-1.25.9/test/test_response.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/test_response.py	2020-06-07 22:25:48.023337809 +0200
+@@ -7,7 +7,10 @@
+ from io import BytesIO, BufferedReader, TextIOWrapper
+ 
+ import pytest
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ import six
+ 
+ from urllib3.response import HTTPResponse, brotli
+--- urllib3-1.25.9/test/test_retry.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/test_retry.py	2020-06-07 22:21:45.327985936 +0200
+@@ -1,5 +1,8 @@
+ import datetime
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ import pytest
+ import time
+ 
+--- urllib3-1.25.9/test/test_ssl.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/test_ssl.py	2020-06-07 22:22:15.301156891 +0200
+@@ -1,4 +1,7 @@
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ import pytest
+ from urllib3.util import ssl_
+ from urllib3.exceptions import SNIMissingWarning
+--- urllib3-1.25.9/test/test_util.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/test_util.py	2020-06-07 22:21:18.341465468 +0200
+@@ -7,7 +7,10 @@
+ import socket
+ from itertools import chain
+ 
+-from mock import patch, Mock
++try:
++    from mock import patch, Mock
++except ImportError:
++    from unittest.mock import patch, Mock
+ import pytest
+ 
+ from urllib3 import add_stderr_logger, disable_warnings
+--- urllib3-1.25.9/test/contrib/test_pyopenssl.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/contrib/test_pyopenssl.py	2020-06-07 22:30:33.011793894 +0200
+@@ -1,7 +1,10 @@
+ # -*- coding: utf-8 -*-
+ import os
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ import pytest
+ 
+ try:
+--- urllib3-1.25.9/test/contrib/test_pyopenssl_dependencies.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/contrib/test_pyopenssl_dependencies.py	2020-06-07 22:31:07.291608185 +0200
+@@ -1,7 +1,10 @@
+ # -*- coding: utf-8 -*-
+ import pytest
+ 
+-from mock import patch, Mock
++try:
++    from mock import patch, Mock
++except ImportError:
++    from unittest.mock import patch, Mock
+ 
+ try:
+     from urllib3.contrib.pyopenssl import inject_into_urllib3, extract_from_urllib3
+--- urllib3-1.25.9/test/with_dummyserver/test_connectionpool.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/with_dummyserver/test_connectionpool.py	2020-06-07 22:20:19.205119170 +0200
+@@ -6,7 +6,10 @@
+ import warnings
+ import pytest
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ from .. import TARPIT_HOST, VALID_SOURCE_ADDRESSES, INVALID_SOURCE_ADDRESSES
+ from ..port_helpers import find_unused_port
+--- urllib3-1.25.9/test/with_dummyserver/test_https.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/with_dummyserver/test_https.py	2020-06-07 22:18:03.172522789 +0200
+@@ -8,7 +8,10 @@
+ import tempfile
+ import warnings
+ 
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ import pytest
+ import trustme
+ 
+--- urllib3-1.25.9/test/with_dummyserver/test_socketlevel.py.orig	2020-04-16 14:42:30.000000000 +0200
++++ urllib3-1.25.9/test/with_dummyserver/test_socketlevel.py	2020-06-07 22:18:29.705712380 +0200
+@@ -44,7 +44,10 @@
+ import shutil
+ import ssl
+ import tempfile
+-import mock
++try:
++    import mock
++except ImportError:
++    from unittest import mock
+ 
+ import pytest
+ import trustme
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-urllib3.git/commitdiff/f5006321ca8bf71b8bbe8b6073712fd75f87a7e9



More information about the pld-cvs-commit mailing list