Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-responses for openSUSE:Factory checked in at 2023-05-19 11:55:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-responses (Old) and /work/SRC/openSUSE:Factory/.python-responses.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-responses" Fri May 19 11:55:09 2023 rev:26 rq:1085860 version:0.23.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-responses/python-responses.changes 2023-04-22 22:00:03.821074125 +0200 +++ /work/SRC/openSUSE:Factory/.python-responses.new.1533/python-responses.changes 2023-05-19 11:55:34.803283312 +0200 @@ -1,0 +2,57 @@ +Tue May 9 22:20:25 UTC 2023 - Matej Cepl <mc...@suse.com> + +- Update 636-urllib3-2-compat.patch (from + gh#getsentry/responses!636). + +------------------------------------------------------------------- +Mon May 8 21:00:43 UTC 2023 - Ben Greiner <c...@bnavigator.de> + +- Fix missing runtime requirements +- Remove runtime requirement of typing stubs + +------------------------------------------------------------------- +Fri May 5 18:05:59 UTC 2023 - Matej Cepl <mc...@suse.com> + +- Update to 0.23.1: + - Remove `tomli` import. See #630 + - Add Python 3.11 support + - Fix type annotations of `CallList`. See #593 + - `request` object is attached to any custom exception provided + as `Response` `body` argument. See #588 + - Fixed mocked responses leaking between tests when + `assert_all_requests_are_fired` and a request was not fired. + - [BETA] Default recorder format was changed to YAML. + Added `responses.RequestsMock._parse_response_file` and + `responses._recorder.Recorder.dump_to_file` methods that + allow users to override default parser to eg toml, json + - Update `requests` dependency to the version of 2.22.0 or + higher. See #584. + - [BETA] Added possibility to record responses to TOML files + via `@_recorder.record(file_path="out.toml")` decorator. + - [BETA] Added possibility to replay responses + (populate registry) from TOML files via + `responses._add_from_file(file_path="out.toml")` method. + - Fix type for the `mock`'s patcher object. See #556 + - Fix type annotation for `CallList` + - Add `passthrough` argument to `BaseResponse` object. See #557 + - Fix `registries` leak. See #563 + - `OriginalResponseShim` is removed. See #585 + - Add support for the `loose` version of `json_params_matcher` + via named argument `strict_match`. See #551 + - Add lists support as JSON objects in + `json_params_matcher`. See #559 + - Added project links to pypi listing. + - `delete`, `get`, `head`, `options`, `patch`, + `post`, `put` shortcuts are now implemented using + `functools.partialmethod`. + - Fix `MaxRetryError` exception. Replace exception by + `RetryError` according to `requests` implementation. See + #572. + - Adjust error message when `Retry` is exhausted. See #580. +- Remove py_old_re_Pattern.patch, because we donât care about + compatibility with pre-SLE15-SP4 any more. +- Add compat-urllib3-2.patch and unbundle-urllib3.patch to make + the package compatible with urllib3 >= 2.0 (still not enough + gh#getsentry/responses#635). + +------------------------------------------------------------------- Old: ---- py_old_re_Pattern.patch responses-0.21.0.tar.gz New: ---- 636-urllib3-2-compat.patch responses-0.23.1.tar.gz unbundle-urllib3.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-responses.spec ++++++ --- /var/tmp/diff_new_pack.sHYa9q/_old 2023-05-19 11:55:35.403286747 +0200 +++ /var/tmp/diff_new_pack.sHYa9q/_new 2023-05-19 11:55:35.407286769 +0200 @@ -16,30 +16,39 @@ # -%{?!python_module:%define python_module() python3-%{**}} -%global skip_python2 1 %{?sle15_python_module_pythons} Name: python-responses -Version: 0.21.0 +Version: 0.23.1 Release: 0 Summary: A utility library for mocking out the `requests` Python library License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/getsentry/responses Source: https://files.pythonhosted.org/packages/source/r/responses/responses-%{version}.tar.gz -# PATCH-FIX-SLE py_old_re_Pattern.patch mc...@suse.com -# Make package compatible with SLE-15 -Patch0: py_old_re_Pattern.patch -# test requirements -BuildRequires: %{python_module cookies} -BuildRequires: %{python_module pytest-localserver} -BuildRequires: %{python_module pytest} -BuildRequires: %{python_module requests >= 2.0} +# PATCH-FIX-UPSTREAM 636-urllib3-2-compat.patch gh#getsentry/responses!636 mc...@suse.com +# Make the package compatible with urllib3 >= 2.0 +Patch0: 636-urllib3-2-compat.patch +# PATCH-FIX-UPSTREAM unbundle-urllib3.patch gh#getsentry/responses#635, mc...@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} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-requests >= 2.0 -Suggests: python-pytest +# SECTION test requirements +BuildRequires: %{python_module cookies} +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 tomli-w} +BuildRequires: %{python_module urllib3 >= 2} +# /SECTION +Requires: python-PyYAML +Requires: python-urllib3 >= 2 +Requires: (python-requests >= 2.22.0 with python-requests < 3) BuildArch: noarch %python_subpackages @@ -51,15 +60,18 @@ %prep %autosetup -p1 -n responses-%{version} +# Remove typing stub requirements +sed -i /types-/d setup.py + %build export LANG="en_US.UTF8" export PYTHONIOENCODING="utf_8" -%python_build +%pyproject_wheel %install export LANG="en_US.UTF8" export PYTHONIOENCODING="utf_8" -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -68,6 +80,7 @@ %files %{python_files} %doc CHANGES README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/responses +%{python_sitelib}/responses-%{version}*-info %changelog ++++++ 636-urllib3-2-compat.patch ++++++ --- CHANGES | 6 ++++++ README.rst | 2 +- responses/tests/test_responses.py | 9 +++++---- setup.py | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +0.23.2 +------ + +* Updated dependency to urllib3>=2 and requests>=2.30.0. See #635 + + 0.23.1 ------ --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ A utility library for mocking out the `` .. note:: - Responses requires Python 3.7 or newer, and requests >= 2.22.0 + Responses requires Python 3.7 or newer, and requests >= 2.30.0 Table of Contents --- a/responses/tests/test_responses.py +++ b/responses/tests/test_responses.py @@ -1498,9 +1498,10 @@ def test_auto_calculate_content_length_d headers={"Content-Length": "2"}, auto_calculate_content_length=True, ) - resp = requests.get(url) - assert_response(resp, "test") - assert resp.headers["Content-Length"] == "2" + with pytest.raises(ChunkedEncodingError) as excinfo: + requests.get(url) + + assert "IncompleteRead(4 bytes read, -2 more expected)" in str(excinfo.value) run() assert_reset() @@ -2416,7 +2417,7 @@ class TestMaxRetry: total=total, backoff_factor=0.1, status_forcelist=[500], - method_whitelist=["GET", "POST", "PATCH"], + allowed_methods=["GET", "POST", "PATCH"], raise_on_status=raise_on_status, ) ) --- a/setup.py +++ b/setup.py @@ -17,8 +17,8 @@ from setuptools.command.test import test setup_requires = [] install_requires = [ - "requests>=2.22.0,<3.0", - "urllib3>=1.25.10", + "requests>=2.23.0,<3.0", + "urllib3>=2.0.0,<3.0", "pyyaml", "types-PyYAML", "typing_extensions; python_version < '3.8'", ++++++ responses-0.21.0.tar.gz -> responses-0.23.1.tar.gz ++++++ ++++ 2133 lines of diff (skipped) ++++++ unbundle-urllib3.patch ++++++ --- 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()