[packages/python-urllib3] - updated to 1.25.11 (last compatible with requests 2.23.x) - updated mock patch

qboosh qboosh at pld-linux.org
Sun Feb 14 17:08:21 CET 2021


commit b07e9d238db8cc7568ec93b1e88dc4986ab7fe01
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Feb 14 17:08:40 2021 +0100

    - updated to 1.25.11 (last compatible with requests 2.23.x)
    - updated mock patch

 python-urllib3-mock.patch | 23 ++++++++++++++++++-----
 python-urllib3.spec       | 37 ++++++++++++++++++++++++++++---------
 2 files changed, 46 insertions(+), 14 deletions(-)
---
diff --git a/python-urllib3.spec b/python-urllib3.spec
index a6ebe47..f35bfd6 100644
--- a/python-urllib3.spec
+++ b/python-urllib3.spec
@@ -10,13 +10,13 @@
 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.9
+Version:	1.25.11
 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:	dbf9b868b90880b24b1ac278094e912e
+# Source0-md5:	d47dd21a6e66a03c3633cac468ffd010
 Patch0:		%{name}-mock.patch
 Patch1:		%{name}-httplib.patch
 URL:		http://urllib3.readthedocs.org/
@@ -26,13 +26,17 @@ BuildRequires:	glibc-localedb-all
 %if %{with python2}
 BuildRequires:	python-modules >= 1:2.7
 %if %{with tests}
-BuildRequires:	python-PySocks >= 1.5.6
+BuildRequires:	python-PySocks >= 1.7.1
 BuildRequires:	python-PySocks < 2.0
 BuildRequires:	python-cryptography >= 2.8
+BuildRequires:	python-dateutil >= 2.8.1
+BuildRequires:	python-flaky >= 3.6.1
 # TODO
 #BuildRequires:	python-gcp_devrel-py-tools >= 0.0.15
 BuildRequires:	python-mock >= 3.0.5
-BuildRequires:	python-pytest
+BuildRequires:	python-pytest >= 4.6.9
+BuildRequires:	python-pytest-freezegun >= 0.3.0
+BuildRequires:	python-pytest-timeout >= 1.3.4
 BuildRequires:	python-tornado >= 5.1.1
 BuildRequires:	python-trustme >= 0.5.3
 # SO_REUSEPORT option
@@ -42,11 +46,15 @@ BuildRequires:	uname(release) >= 3.9
 %if %{with python3}
 BuildRequires:	python3-modules >= 1:3.5
 %if %{with tests}
-BuildRequires:	python3-PySocks >= 1.5.6
+BuildRequires:	python3-PySocks >= 1.7.1
 BuildRequires:	python3-PySocks < 2.0
 BuildRequires:	python3-cryptography >= 2.8
+BuildRequires:	python3-dateutil >= 2.8.1
+BuildRequires:	python3-flaky >= 3.6.1
 #BuildRequires:	python3-gcp_devrel-py-tools >= 0.0.15
-BuildRequires:	python3-pytest
+BuildRequires:	python3-pytest >= 4.6.9
+BuildRequires:	python3-pytest-freezegun >= 0.4.2
+BuildRequires:	python3-pytest-timeout >= 1.3.4
 BuildRequires:	python3-tornado >= 6.0.3
 BuildRequires:	python3-trustme >= 0.5.3
 # SO_REUSEPORT option
@@ -129,10 +137,16 @@ Dokumentacja API modułu Pythona urllib3.
 %if %{with python2}
 %py_build
 
-%if %{with tests_py2}
+%if %{with tests}
+# RECENT_DATE is too old
+# test_retry.py: many failures with py2
+# TestSSL: unknown ca, timeout errors etc.
 LC_ALL=C.UTF-8 \
 PYTHONPATH=$(pwd)/src \
-%{__python} -m pytest test
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="flaky.flaky_pytest_plugin,pytest_freezegun,pytest_timeout" \
+%{__python} -m pytest test -k 'not (test_recent_date or test_retry or test_ssl_read_timeout or test_ssl_failed_fingerprint_verification)'
+# or TestSSL)'
 %endif
 %endif
 
@@ -140,8 +154,12 @@ PYTHONPATH=$(pwd)/src \
 %py3_build
 
 %if %{with tests}
+# RECENT_DATE is too old
+# TestSSL: verification errors
 PYTHONPATH=$(pwd)/src \
-%{__python3} -m pytest test
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="flaky.flaky_pytest_plugin,pytest_freezegun,pytest_timeout" \
+%{__python3} -m pytest test -k 'not (test_recent_date or test_ssl_read_timeout or test_ssl_failed_fingerprint_verification)'
 %endif
 %endif
 
@@ -156,6 +174,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %if %{with python2}
 %py_install
+
 %py_postclean
 %endif
 
diff --git a/python-urllib3-mock.patch b/python-urllib3-mock.patch
index d739a3e..cf1a748 100644
--- a/python-urllib3-mock.patch
+++ b/python-urllib3-mock.patch
@@ -24,6 +24,20 @@
  
  import pytest
  
+--- urllib3-1.25.11/test/test_connectionpool.py.orig	2020-10-19 16:17:05.000000000 +0200
++++ urllib3-1.25.11/test/test_connectionpool.py	2021-02-14 14:23:15.248962491 +0100
+@@ -2,7 +2,10 @@
+ 
+ import ssl
+ import pytest
+-from mock import Mock
++try:
++    from mock import Mock
++except ImportError:
++    from unittest.mock import Mock
+ 
+ from urllib3.connectionpool import (
+     connection_from_url,
 --- 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 @@
@@ -51,18 +65,17 @@
  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
+--- urllib3-1.25.11/test/test_retry.py.orig	2021-02-14 13:38:08.446959829 +0100
++++ urllib3-1.25.11/test/test_retry.py	2021-02-14 13:39:36.619815489 +0100
+@@ -1,4 +1,7 @@
 -import mock
 +try:
 +    import mock
 +except ImportError:
 +    from unittest import mock
  import pytest
- import time
  
+ from urllib3.response import HTTPResponse
 --- 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 @@
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list