Hello community,

here is the log from the commit of package python-urllib3 for openSUSE:Factory 
checked in at 2015-11-24 22:33:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-urllib3 (Old)
 and      /work/SRC/openSUSE:Factory/.python-urllib3.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-urllib3"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-urllib3/python-urllib3.changes    
2015-10-20 00:05:10.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-urllib3.new/python-urllib3.changes       
2015-11-24 22:33:53.000000000 +0100
@@ -1,0 +2,19 @@
+Wed Oct 27 16:33:44 UTC 2015 - jmate...@suse.com
+
+- removed python-certifi dependency, we don't want to use it
+- drop 0001-Don-t-pin-dependency-to-exact-version.patch because it's
+  not needed anymore
+- re-enable tests, re-add relevant dependencies
+  * don't exclude test_util.py
+  * exclude proxy timeout tests that fail for spurious reasons
+- urllib3-ssl-default-context.patch - use set_default_verify_paths()
+  if no certificate path specified and verification not explicitly
+  disabled
+- urllib3-test-ssl-drop-sslv3.patch - don't use "SSLv3" constants
+  in python 2.7.9 and up
+- ready-event.patch - fix race conditions in timeout tests
+- drop %pre section because apparently "egg-info as file" is no longer
+  true and this breaks builds
+
+
+-------------------------------------------------------------------

Old:
----
  0001-Don-t-pin-dependency-to-exact-version.patch

New:
----
  ready-event.patch
  urllib3-ssl-default-context.patch
  urllib3-test-ssl-drop-sslv3.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-urllib3.spec ++++++
--- /var/tmp/diff_new_pack.FyYajI/_old  2015-11-24 22:33:54.000000000 +0100
+++ /var/tmp/diff_new_pack.FyYajI/_new  2015-11-24 22:33:54.000000000 +0100
@@ -24,12 +24,20 @@
 Group:          Development/Languages/Python
 Url:            http://urllib3.readthedocs.org/
 Source:         
https://pypi.python.org/packages/source/u/urllib3/urllib3-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM speili...@suse.com -- 
https://github.com/shazow/urllib3/pull/361
-Patch0:         0001-Don-t-pin-dependency-to-exact-version.patch
 # PATCH-FIX-OPENSUSE speili...@suse.com -- We need no coverage report
 Patch1:         urllib3-test-no-coverage.patch
+# PATCH-FEATURE-UPSTREAM -- use set_default_verify_paths() if no certificate 
path is supplied
+Patch2:         urllib3-ssl-default-context.patch
+# PATCH-FIX-OPENSUSE -- do not use unsupported SSLv3 in tests
+Patch3:         urllib3-test-ssl-drop-sslv3.patch
+# PATCH-FIX-UPSTREAM -- fix race conditions with ready_event state variable in 
timeout tests
+Patch4:         ready-event.patch
+#!BuildIgnore: python-requests
 BuildRequires:  python-devel
-Requires:       python-certifi
+BuildRequires:  python-mock >= 1.3.0
+BuildRequires:  python-nose >= 1.3.7
+BuildRequires:  python-nose-exclude >= 0.4.1
+BuildRequires:  python-tornado >= 4.2.1
 Requires:       python-pyOpenSSL
 Requires:       python-pyasn1
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -57,8 +65,12 @@
 
 %prep
 %setup -q -n urllib3-%{version}
-%patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%if %(python -c "import ssl; print(hasattr(ssl,'PROTOCOL_TLSv1_2'))") == "True"
+%patch3 -p1
+%endif
+%patch4 -p1
 
 %build
 python setup.py build
@@ -66,12 +78,18 @@
 %install
 python setup.py install --prefix=%{_prefix} --root=%{buildroot}
 
-%pre
+%check
+rm -rf build
+PYTHONPATH="%{buildroot}%{python_sitelib}" nosetests \
+       
--exclude-test=test.with_dummyserver.test_proxy_poolmanager.TestHTTPProxyManager.test_https_proxy_timeout
 \
+       
--exclude-test=test.with_dummyserver.test_proxy_poolmanager.TestHTTPProxyManager.test_https_proxy_pool_timeout
+
+#%pre
 # previous versions of the package installed .egg-info as a directory,
 # the new update now installs it as a file. Clean out the directory, should it 
exist.
-if [ -d %{python_sitelib}/urllib3-%{version}-py*.egg-info ]; then
-  rm -rf %{python_sitelib}/urllib3-%{version}-py*.egg-info
-fi
+#if [ -d %{python_sitelib}/urllib3-%{version}-py*.egg-info ]; then
+#  rm -rf %{python_sitelib}/urllib3-%{version}-py*.egg-info
+#fi
 
 %files
 %defattr(-,root,root,-)

++++++ ready-event.patch ++++++
Index: urllib3-1.12/dummyserver/testcase.py
===================================================================
--- urllib3-1.12.orig/dummyserver/testcase.py
+++ urllib3-1.12/dummyserver/testcase.py
@@ -45,7 +45,7 @@ class SocketDummyServerTestCase(unittest
         def socket_handler(listener):
             for _ in range(num):
                 ready_event.set()
-                ready_event.clear()
+                #ready_event.clear()
 
                 sock = listener.accept()[0]
                 consume_socket(sock)
@@ -59,6 +59,11 @@ class SocketDummyServerTestCase(unittest
         return ready_event
 
     @classmethod
+    def wait_for_socket(cls, ready_event):
+        ready_event.wait()
+        ready_event.clear()
+
+    @classmethod
     def start_basic_handler(cls, **kw):
         return cls.start_response_handler(
            b'HTTP/1.1 200 OK\r\n'
Index: urllib3-1.12/test/with_dummyserver/test_connectionpool.py
===================================================================
--- urllib3-1.12.orig/test/with_dummyserver/test_connectionpool.py
+++ urllib3-1.12/test/with_dummyserver/test_connectionpool.py
@@ -57,11 +57,12 @@ class TestConnectionPoolTimeouts(SocketD
 
         # Pool-global timeout
         pool = HTTPConnectionPool(self.host, self.port, timeout=SHORT_TIMEOUT, 
retries=False)
+        self.wait_for_socket(ready_event)
         self.assertRaises(ReadTimeoutError, pool.request, 'GET', '/')
         block_event.set() # Release block
 
         # Shouldn't raise this time
-        ready_event.wait()
+        self.wait_for_socket(ready_event)
         block_event.set() # Pre-release block
         pool.request('GET', '/')
 
@@ -92,12 +93,13 @@ class TestConnectionPoolTimeouts(SocketD
         timeout = Timeout(read=SHORT_TIMEOUT)
         pool = HTTPConnectionPool(self.host, self.port, timeout=timeout, 
retries=False)
 
+        self.wait_for_socket(ready_event)
         conn = pool._get_conn()
         self.assertRaises(ReadTimeoutError, pool._make_request, conn, 'GET', 
'/')
         pool._put_conn(conn)
         block_event.set() # Release request
 
-        ready_event.wait()
+        self.wait_for_socket(ready_event)
         block_event.clear()
         self.assertRaises(ReadTimeoutError, pool.request, 'GET', '/')
         block_event.set() # Release request
@@ -106,7 +108,7 @@ class TestConnectionPoolTimeouts(SocketD
         pool = HTTPConnectionPool(self.host, self.port, timeout=LONG_TIMEOUT, 
retries=False)
 
         conn = pool._get_conn()
-        ready_event.wait()
+        self.wait_for_socket(ready_event)
         now = time.time()
         self.assertRaises(ReadTimeoutError, pool._make_request, conn, 'GET', 
'/', timeout=timeout)
         delta = time.time() - now
@@ -115,7 +117,7 @@ class TestConnectionPoolTimeouts(SocketD
         self.assertTrue(delta < LONG_TIMEOUT, "timeout was pool-level 
LONG_TIMEOUT rather than request-level SHORT_TIMEOUT")
         pool._put_conn(conn)
 
-        ready_event.wait()
+        self.wait_for_socket(ready_event)
         now = time.time()
         self.assertRaises(ReadTimeoutError, pool.request, 'GET', '/', 
timeout=timeout)
         delta = time.time() - now
@@ -125,11 +127,11 @@ class TestConnectionPoolTimeouts(SocketD
 
         # Timeout int/float passed directly to request and _make_request should
         # raise a request timeout
-        ready_event.wait()
+        self.wait_for_socket(ready_event)
         self.assertRaises(ReadTimeoutError, pool.request, 'GET', '/', 
timeout=SHORT_TIMEOUT)
         block_event.set() # Release request
 
-        ready_event.wait()
+        self.wait_for_socket(ready_event)
         conn = pool._new_conn()
         # FIXME: This assert flakes sometimes. Not sure why.
         self.assertRaises(ReadTimeoutError, pool._make_request, conn, 'GET', 
'/', timeout=SHORT_TIMEOUT)
@@ -183,13 +185,14 @@ class TestConnectionPoolTimeouts(SocketD
         block_event = Event()
         ready_event = self.start_basic_handler(block_send=block_event, num=2)
 
+        self.wait_for_socket(ready_event)
         # This will get the socket to raise an EAGAIN on the read
         timeout = Timeout(connect=3, read=SHORT_TIMEOUT)
         pool = HTTPConnectionPool(self.host, self.port, timeout=timeout, 
retries=False)
         self.assertRaises(ReadTimeoutError, pool.request, 'GET', '/')
 
         block_event.set()
-        ready_event.wait()
+        self.wait_for_socket(ready_event)
         block_event.clear()
 
         # The connect should succeed and this should hit the read timeout
++++++ urllib3-ssl-default-context.patch ++++++
Index: urllib3-1.12/urllib3/util/ssl_.py
===================================================================
--- urllib3-1.12.orig/urllib3/util/ssl_.py
+++ urllib3-1.12/urllib3/util/ssl_.py
@@ -278,6 +278,8 @@ def ssl_wrap_socket(sock, keyfile=None,
             if e.errno == errno.ENOENT:
                 raise SSLError(e)
             raise
+    elif cert_reqs != ssl.CERT_NONE and hasattr(context, 
'set_default_verify_paths'):
+        context.set_default_verify_paths()
 
     if certfile:
         context.load_cert_chain(certfile, keyfile)
++++++ urllib3-test-ssl-drop-sslv3.patch ++++++
Index: urllib3-1.12/test/with_dummyserver/test_https.py
===================================================================
--- urllib3-1.12.orig/test/with_dummyserver/test_https.py
+++ urllib3-1.12/test/with_dummyserver/test_https.py
@@ -416,21 +416,21 @@ class TestHTTPS(HTTPSDummyServerTestCase
 
 class TestHTTPS_TLSv1(HTTPSDummyServerTestCase):
     certs = DEFAULT_CERTS.copy()
-    certs['ssl_version'] = ssl.PROTOCOL_TLSv1
+    certs['ssl_version'] = ssl.PROTOCOL_TLSv1_2
 
     def setUp(self):
         self._pool = HTTPSConnectionPool(self.host, self.port)
 
-    def test_set_ssl_version_to_sslv3(self):
-        self._pool.ssl_version = ssl.PROTOCOL_SSLv3
+    def test_set_ssl_version_to_tlsv1(self):
+        self._pool.ssl_version = ssl.PROTOCOL_TLSv1
         self.assertRaises(SSLError, self._pool.request, 'GET', '/')
 
     def test_ssl_version_as_string(self):
-        self._pool.ssl_version = 'PROTOCOL_SSLv3'
+        self._pool.ssl_version = 'PROTOCOL_TLSv1'
         self.assertRaises(SSLError, self._pool.request, 'GET', '/')
 
     def test_ssl_version_as_short_string(self):
-        self._pool.ssl_version = 'SSLv3'
+        self._pool.ssl_version = 'TLSv1'
         self.assertRaises(SSLError, self._pool.request, 'GET', '/')
 
     def test_discards_connection_on_sslerror(self):

Reply via email to