From cb5fe533b10dec1ea9b95d0034544f8ed22b591ca912251f8accbce7906fc956 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 2 Oct 2023 16:48:43 +0000 Subject: [PATCH] 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 --- python-responses.changes | 14 ++++++++ python-responses.spec | 14 +++----- responses-0.23.1.tar.gz | 3 -- responses-0.23.3.tar.gz | 3 ++ unbundle-urllib3.patch | 75 ---------------------------------------- 5 files changed, 22 insertions(+), 87 deletions(-) delete mode 100644 responses-0.23.1.tar.gz create mode 100644 responses-0.23.3.tar.gz delete mode 100644 unbundle-urllib3.patch diff --git a/python-responses.changes b/python-responses.changes index b4cc189..ecd5715 100644 --- a/python-responses.changes +++ b/python-responses.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Sat Sep 30 19:38:00 UTC 2023 - Ben Greiner + +- 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 diff --git a/python-responses.spec b/python-responses.spec index a3ac19f..2cae7a0 100644 --- a/python-responses.spec +++ b/python-responses.spec @@ -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 diff --git a/responses-0.23.1.tar.gz b/responses-0.23.1.tar.gz deleted file mode 100644 index c3d83fe..0000000 --- a/responses-0.23.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c4d9aa9fc888188f0c673eff79a8dadbe2e75b7fe879dc80a221a06e0a68138f -size 72966 diff --git a/responses-0.23.3.tar.gz b/responses-0.23.3.tar.gz new file mode 100644 index 0000000..3604f93 --- /dev/null +++ b/responses-0.23.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:205029e1cb334c21cb4ec64fc7599be48b859a0fd381a42443cdd600bfe8b16a +size 73737 diff --git a/unbundle-urllib3.patch b/unbundle-urllib3.patch deleted file mode 100644 index 8f9d838..0000000 --- a/unbundle-urllib3.patch +++ /dev/null @@ -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()