14
0

baserev update by copy to link target

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urllib3_1?expand=0&rev=7
This commit is contained in:
OBS User buildservice-autocommit
2023-05-19 09:55:26 +00:00
committed by Git OBS Bridge
commit bae1ebaf26
7 changed files with 1494 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

1055
python-urllib3_1.changes Normal file

File diff suppressed because it is too large Load Diff

148
python-urllib3_1.spec Normal file
View File

@@ -0,0 +1,148 @@
#
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons}
Name: python-urllib3_1%{psuffix}
Version: 1.26.15
Release: 0
Summary: HTTP library with thread-safe connection pooling, file post, and more
License: MIT
Group: Development/Languages/Python
URL: https://urllib3.readthedocs.org/
Source: https://files.pythonhosted.org/packages/source/u/urllib3/urllib3-%{version}.tar.gz
# PATCH-FIX-UPSTREAM remove_mock.patch gh#urllib3/urllib3#2108 mcepl@suse.com
# remove dependency on the external module mock
Patch0: remove_mock.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
#!BuildIgnore: python-requests
Requires: ca-certificates-mozilla
Requires: python-certifi
Requires: python-cryptography >= 1.3.4
Requires: python-idna >= 2.0.0
Requires: python-pyOpenSSL >= 0.14
Requires: python-six >= 1.12.0
Recommends: python-Brotli >= 1.0.9
Recommends: python-PySocks >= 1.5.6
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module Brotli >= 1.0.9}
BuildRequires: %{python_module PySocks >= 1.5.6}
BuildRequires: %{python_module certifi}
BuildRequires: %{python_module cryptography >= 1.3.4}
BuildRequires: %{python_module dateutil}
BuildRequires: %{python_module flaky}
BuildRequires: %{python_module idna >= 2.0.0}
BuildRequires: %{python_module psutil}
BuildRequires: %{python_module pytest-freezegun}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module tornado >= 6}
BuildRequires: %{python_module trustme >= 0.5.3}
BuildRequires: %{python_module urllib3_1 >= %{version}}
%else
Provides: python-urllib3 = %{version}
Conflicts: python-urllib3 >= 2
%endif
%python_subpackages
%description
Highlights
- Re-use the same socket connection for multiple requests
(HTTPConnectionPool and HTTPSConnectionPool)
(with optional client-side certificate verification).
- File posting (encode_multipart_formdata).
- Built-in redirection and retries (optional).
- Supports gzip and deflate decoding.
- Thread-safe and sanity-safe.
- Works with AppEngine, gevent, and eventlib.
- Tested on Python 2.6+ and Python 3.3+, 100% unit test coverage.
- Small and easy to understand codebase perfect for extending and building upon.
For a more comprehensive solution, have a look at
Requests which is also powered by urllib3.
%prep
%autosetup -p1 -n urllib3-%{version}
find . -type f -exec chmod a-x '{}' \;
find . -name __pycache__ -type d -exec rm -fr {} +
# Drop the dummyserver tests, they fail in OBS
rm test/with_dummyserver/test_proxy_poolmanager.py
rm test/with_dummyserver/test_poolmanager.py
# Don't run the Google App Engine tests
rm -r test/appengine/
%build
%python_build
%install
%if !%{with test}
%python_install
%{python_expand # Unbundle six
rm %{buildroot}/%{$python_sitelib}/urllib3/packages/six.py
rm %{buildroot}/%{$python_sitelib}/urllib3/packages/__pycache__/six*.pyc
ln -s %{$python_sitelib}/six.py %{buildroot}/%{$python_sitelib}/urllib3/packages/six.py
ln -sf %{$python_sitelib}/__pycache__/six.cpython-%{$python_version_nodots}.opt-1.pyc \
%{buildroot}/%{$python_sitelib}/urllib3/packages/__pycache__/
ln -sf %{$python_sitelib}/__pycache__/six.cpython-%{$python_version_nodots}.pyc \
%{buildroot}/%{$python_sitelib}/urllib3/packages/__pycache__/
%fdupes %{buildroot}%{$python_sitelib}
}
%endif
%if %{with test}
%check
# gh#urllib3/urllib3#2109
export CI="true"
# skip some randomly failing tests (mostly on i586, but sometimes they fail on other architectures)
skiplist="test_ssl_read_timeout or test_ssl_failed_fingerprint_verification or test_ssl_custom_validation_failure_terminates"
# gh#urllib3/urllib3#1752 and others: upstream's way of checking that the build
# system has a correct system time breaks (re-)building the package after too
# many months have passed since the last release.
skiplist+=" or test_recent_date"
# too slow to run in obs (checks 2GiB of data)
skiplist+=" or test_requesting_large_resources_via_ssl"
%pytest -k "not (${skiplist})"
%endif
%if ! %{with test}
%files %{python_files}
%license LICENSE.txt
%doc CHANGES.rst README.rst
%{python_sitelib}/urllib3
%{python_sitelib}/urllib3-%{version}*-info
%endif
%changelog

261
remove_mock.patch Normal file
View File

@@ -0,0 +1,261 @@
Index: urllib3-1.26.10/docs/conf.py
===================================================================
--- urllib3-1.26.10.orig/docs/conf.py
+++ urllib3-1.26.10/docs/conf.py
@@ -14,7 +14,10 @@ sys.path.insert(0, root_path)
# Mock some expensive/platform-specific modules so build will work.
# (https://read-the-docs.readthedocs.io/en/latest/faq.html#\
# i-get-import-errors-on-libraries-that-depend-on-c-modules)
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
class MockModule(mock.Mock):
Index: urllib3-1.26.10/test/contrib/test_pyopenssl.py
===================================================================
--- urllib3-1.26.10.orig/test/contrib/test_pyopenssl.py
+++ urllib3-1.26.10/test/contrib/test_pyopenssl.py
@@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
import os
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
try:
Index: urllib3-1.26.10/test/contrib/test_pyopenssl_dependencies.py
===================================================================
--- urllib3-1.26.10.orig/test/contrib/test_pyopenssl_dependencies.py
+++ urllib3-1.26.10/test/contrib/test_pyopenssl_dependencies.py
@@ -1,6 +1,9 @@
# -*- coding: utf-8 -*-
import pytest
-from mock import Mock, patch
+try:
+ from unittest.mock import Mock, patch
+except ImportError:
+ from mock import Mock, patch
try:
from urllib3.contrib.pyopenssl import extract_from_urllib3, inject_into_urllib3
Index: urllib3-1.26.10/test/test_connection.py
===================================================================
--- urllib3-1.26.10.orig/test/test_connection.py
+++ urllib3-1.26.10/test/test_connection.py
@@ -1,6 +1,9 @@
import datetime
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
from urllib3.connection import RECENT_DATE, CertificateError, _match_hostname
Index: urllib3-1.26.10/test/test_connectionpool.py
===================================================================
--- urllib3-1.26.10.orig/test/test_connectionpool.py
+++ urllib3-1.26.10/test/test_connectionpool.py
@@ -6,7 +6,10 @@ from ssl import SSLError as BaseSSLError
from test import SHORT_TIMEOUT
import pytest
-from mock import Mock
+try:
+ from unittest.mock import Mock
+except ImportError:
+ from mock import Mock
from dummyserver.server import DEFAULT_CA
from urllib3._collections import HTTPHeaderDict
Index: urllib3-1.26.10/test/test_queue_monkeypatch.py
===================================================================
--- urllib3-1.26.10.orig/test/test_queue_monkeypatch.py
+++ urllib3-1.26.10/test/test_queue_monkeypatch.py
@@ -1,6 +1,9 @@
from __future__ import absolute_import
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
from urllib3 import HTTPConnectionPool
Index: urllib3-1.26.10/test/test_response.py
===================================================================
--- urllib3-1.26.10.orig/test/test_response.py
+++ urllib3-1.26.10/test/test_response.py
@@ -9,7 +9,10 @@ from base64 import b64decode
from io import BufferedReader, BytesIO, TextIOWrapper
from test import onlyBrotlipy
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
import six
Index: urllib3-1.26.10/test/test_retry.py
===================================================================
--- urllib3-1.26.10.orig/test/test_retry.py
+++ urllib3-1.26.10/test/test_retry.py
@@ -1,6 +1,9 @@
import warnings
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
from urllib3.exceptions import (
Index: urllib3-1.26.10/test/test_retry_deprecated.py
===================================================================
--- urllib3-1.26.10.orig/test/test_retry_deprecated.py
+++ urllib3-1.26.10/test/test_retry_deprecated.py
@@ -1,7 +1,10 @@
# This is a copy-paste of test_retry.py with extra asserts about deprecated options. It will be removed for v2.
import warnings
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
from urllib3.exceptions import (
Index: urllib3-1.26.10/test/test_ssl.py
===================================================================
--- urllib3-1.26.10.orig/test/test_ssl.py
+++ urllib3-1.26.10/test/test_ssl.py
@@ -1,6 +1,9 @@
from test import notPyPy2
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
from urllib3.exceptions import SNIMissingWarning
Index: urllib3-1.26.10/test/test_ssltransport.py
===================================================================
--- urllib3-1.26.10.orig/test/test_ssltransport.py
+++ urllib3-1.26.10/test/test_ssltransport.py
@@ -4,7 +4,10 @@ import socket
import ssl
import sys
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
from dummyserver.server import DEFAULT_CA, DEFAULT_CERTS
Index: urllib3-1.26.10/test/test_util.py
===================================================================
--- urllib3-1.26.10.orig/test/test_util.py
+++ urllib3-1.26.10/test/test_util.py
@@ -9,7 +9,10 @@ from itertools import chain
from test import notBrotlipy, onlyBrotlipy, onlyPy2, onlyPy3
import pytest
-from mock import Mock, patch
+try:
+ from unittest.mock import Mock, patch
+except ImportError:
+ from mock import Mock, patch
from urllib3 import add_stderr_logger, disable_warnings, util
from urllib3.exceptions import (
Index: urllib3-1.26.10/test/with_dummyserver/test_connectionpool.py
===================================================================
--- urllib3-1.26.10.orig/test/with_dummyserver/test_connectionpool.py
+++ urllib3-1.26.10/test/with_dummyserver/test_connectionpool.py
@@ -12,7 +12,10 @@ import warnings
from test import LONG_TIMEOUT, SHORT_TIMEOUT, onlyPy2
from threading import Event
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
import six
Index: urllib3-1.26.10/test/with_dummyserver/test_https.py
===================================================================
--- urllib3-1.26.10.orig/test/with_dummyserver/test_https.py
+++ urllib3-1.26.10/test/with_dummyserver/test_https.py
@@ -18,7 +18,10 @@ from test import (
resolvesLocalhostFQDN,
)
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
import trustme
Index: urllib3-1.26.10/test/with_dummyserver/test_socketlevel.py
===================================================================
--- urllib3-1.26.10.orig/test/with_dummyserver/test_socketlevel.py
+++ urllib3-1.26.10/test/with_dummyserver/test_socketlevel.py
@@ -53,7 +53,10 @@ from test import (
)
from threading import Event
-import mock
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
import pytest
import trustme
Index: urllib3-1.26.10/test/test_poolmanager.py
===================================================================
--- urllib3-1.26.10.orig/test/test_poolmanager.py
+++ urllib3-1.26.10/test/test_poolmanager.py
@@ -2,7 +2,11 @@ import socket
from test import resolvesLocalhostFQDN
import pytest
-from mock import patch
+
+try:
+ import unittest.mock as mock
+except ImportError:
+ import mock
from urllib3 import connection_from_url
from urllib3.exceptions import ClosedPoolError, LocationValueError
@@ -383,7 +387,7 @@ class TestPoolManager(object):
"http://[a::b%25zone]",
],
)
- @patch("urllib3.util.connection.create_connection")
+ @mock.patch("urllib3.util.connection.create_connection")
def test_e2e_connect_to_ipv6_scoped(self, create_connection, url):
"""Checks that IPv6 scoped addresses are properly handled end-to-end.

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

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