14
0

- 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`,

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-responses?expand=0&rev=51
This commit is contained in:
2023-05-06 15:28:42 +00:00
committed by Git OBS Bridge
parent 7cb08faed5
commit f22070e9d3
7 changed files with 176 additions and 85 deletions

View File

@@ -16,26 +16,33 @@
#
%{?!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 mcepl@suse.com
# Make package compatible with SLE-15
Patch0: py_old_re_Pattern.patch
# PATCH-FIX-UPSTREAM unbundle-urllib3.patch bsc#[0-9]+ mcepl@suse.com
# Don't use urllib3 bundled in requests.
Patch0: unbundle-urllib3.patch
# PATCH-{FIX|FEATURE}-{OPENSUSE|SLE|UPSTREAM} name-of-file.patch bsc#[0-9]+ mcepl@suse.com
# this patch makes things totally awesome
Patch1: compat-urllib3-2.patch
# test requirements
BuildRequires: %{python_module cookies}
BuildRequires: %{python_module pytest-localserver}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-httpserver}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests >= 2.0}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module tomli-w}
BuildRequires: %{python_module urllib3 >= 2.0}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-requests >= 2.0
@@ -49,25 +56,32 @@ Check https://github.com/getsentry/responses for more information
about the library.
%prep
%autosetup -p1 -n responses-%{version}
%setup -q -n responses-%{version}
%autopatch -p1
%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
%pytest
# gh#getsentry/responses#635
skiptests="test_auto_calculate_content_length_doesnt_override_existing_value"
# gh#python/cpython!98095 has not been backported to 3.9
python39_skiptests=" or test_registry_async or test_async_calls"
%pytest -k "not ($skiptests ${$python_skiptests})"
%files %{python_files}
%doc CHANGES README.rst
%license LICENSE
%{python_sitelib}/*
%{python_sitelib}/responses
%{python_sitelib}/responses-%{version}*-info
%changelog