Accepting request 1114567 from home:bnavigator:branches:devel:languages:python

- Update to 0.23.3
  * Allow urllib3>=1.25.10
- Release 0.23.2
  * Updated dependency to urllib3>=2 and requests>=2.30.0. See #635
  * Fixed issue when custom adapters were sending only positional
    args. See #642
  * Expose `unbound_on_send` method in `RequestsMock` class. This
    method returns new function that is called by `RequestsMock`
    instead of original `send` method defined by any adapter.
- Drop unbundle-urllib3.patch

OBS-URL: https://build.opensuse.org/request/show/1114567
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-responses?expand=0&rev=61
This commit is contained in:
Matej Cepl 2023-10-02 16:48:43 +00:00 committed by Git OBS Bridge
parent fc8a447851
commit cb5fe533b1
5 changed files with 22 additions and 87 deletions

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Sat Sep 30 19:38:00 UTC 2023 - Ben Greiner <code@bnavigator.de>
- Update to 0.23.3
* Allow urllib3>=1.25.10
- Release 0.23.2
* Updated dependency to urllib3>=2 and requests>=2.30.0. See #635
* Fixed issue when custom adapters were sending only positional
args. See #642
* Expose `unbound_on_send` method in `RequestsMock` class. This
method returns new function that is called by `RequestsMock`
instead of original `send` method defined by any adapter.
- Drop unbundle-urllib3.patch
-------------------------------------------------------------------
Tue May 23 12:47:08 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -18,16 +18,12 @@
%{?sle15_python_module_pythons}
Name: python-responses
Version: 0.23.1
Version: 0.23.3
Release: 0
Summary: A utility library for mocking out the `requests` Python library
License: Apache-2.0
URL: https://github.com/getsentry/responses
Source: https://files.pythonhosted.org/packages/source/r/responses/responses-%{version}.tar.gz
# Waiting for the death of urllib3 1.x due to boto: gh#getsentry/responses!636
# PATCH-FIX-UPSTREAM unbundle-urllib3.patch gh#getsentry/responses#635, mcepl@suse.com
# Don't use urllib3 bundled in requests.
Patch1: unbundle-urllib3.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
@ -39,13 +35,13 @@ BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-httpserver}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests >= 2.22 with %python-requests < 3}
BuildRequires: %{python_module requests >= 2.30 with %python-requests < 3}
BuildRequires: %{python_module tomli-w}
BuildRequires: %{python_module urllib3 < 2}
BuildRequires: %{python_module urllib3 >= 1.25.1 with %python-urllib3 < 3}
# /SECTION
Requires: python-PyYAML
Requires: python-urllib3 < 2
Requires: (python-requests >= 2.22.0 with python-requests < 3)
Requires: (python-requests >= 2.30.0 with python-requests < 3)
Requires: (python-urllib3 >= 1.25.1 with python-urllib3 < 3)
BuildArch: noarch
%python_subpackages

View File

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

BIN
responses-0.23.3.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,75 +0,0 @@
---
responses/__init__.py | 8 ++++----
responses/matchers.py | 2 +-
responses/tests/test_responses.py | 5 +++--
3 files changed, 8 insertions(+), 7 deletions(-)
--- a/responses/__init__.py
+++ b/responses/__init__.py
@@ -42,16 +42,16 @@ except ImportError: # pragma: no cover
from typing import Literal # type: ignore # pragma: no cover
try:
- from requests.packages.urllib3.response import HTTPResponse
+ from urllib3.response import HTTPResponse
except ImportError: # pragma: no cover
from urllib3.response import HTTPResponse # pragma: no cover
try:
- from requests.packages.urllib3.connection import HTTPHeaderDict
+ from urllib3.connection import HTTPHeaderDict
except ImportError: # pragma: no cover
from urllib3.response import HTTPHeaderDict # type: ignore[attr-defined]
try:
- from requests.packages.urllib3.util.url import parse_url
+ from urllib3.util.url import parse_url
except ImportError: # pragma: no cover
from urllib3.util.url import parse_url # pragma: no cover
@@ -1065,7 +1065,7 @@ class RequestsMock(object):
retries = retries or adapter.max_retries
# first validate that current request is eligible to be retried.
- # See ``requests.packages.urllib3.util.retry.Retry`` documentation.
+ # See ``urllib3.util.retry.Retry`` documentation.
if retries.is_retry(
method=response.request.method, status_code=response.status_code # type: ignore[misc]
):
--- a/responses/matchers.py
+++ b/responses/matchers.py
@@ -11,7 +11,7 @@ from urllib.parse import parse_qsl
from urllib.parse import urlparse
from requests import PreparedRequest
-from requests.packages.urllib3.util.url import parse_url
+from urllib3.util.url import parse_url
def _create_key_val_str(input_dict: Union[Dict[Any, Any], Any]) -> str:
--- a/responses/tests/test_responses.py
+++ b/responses/tests/test_responses.py
@@ -13,6 +13,7 @@ from unittest.mock import patch
import pytest
import requests
+import urllib3
from requests.exceptions import ChunkedEncodingError
from requests.exceptions import ConnectionError
from requests.exceptions import HTTPError
@@ -1324,14 +1325,14 @@ def test_content_length_error(monkeypatc
# Type errors here and on 1250 are ignored because the stubs for requests
# are off https://github.com/python/typeshed/blob/f8501d33c737482a829c6db557a0be26895c5941
# /stubs/requests/requests/packages/__init__.pyi#L1
- original_init = getattr(requests.packages.urllib3.HTTPResponse, "__init__") # type: ignore
+ original_init = getattr(urllib3.HTTPResponse, "__init__") # type: ignore
def patched_init(self, *args, **kwargs):
kwargs["enforce_content_length"] = True
original_init(self, *args, **kwargs)
monkeypatch.setattr(
- requests.packages.urllib3.HTTPResponse, "__init__", patched_init # type: ignore
+ urllib3.HTTPResponse, "__init__", patched_init # type: ignore
)
run()