14
0
Files
python-responses/python-responses.spec
Matej Cepl f22070e9d3 - 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
2023-05-06 15:28:42 +00:00

88 lines
2.9 KiB
RPMSpec

#
# spec file for package python-responses
#
# 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 skip_python2 1
%{?sle15_python_module_pythons}
Name: python-responses
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-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 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 tomli-w}
BuildRequires: %{python_module urllib3 >= 2.0}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-requests >= 2.0
Suggests: python-pytest
BuildArch: noarch
%python_subpackages
%description
A utility library for mocking out the requests Python library.
Check https://github.com/getsentry/responses for more information
about the library.
%prep
%setup -q -n responses-%{version}
%autopatch -p1
%build
export LANG="en_US.UTF8"
export PYTHONIOENCODING="utf_8"
%pyproject_wheel
%install
export LANG="en_US.UTF8"
export PYTHONIOENCODING="utf_8"
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# 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}/responses
%{python_sitelib}/responses-%{version}*-info
%changelog