2018-03-23 16:14:07 +01:00
|
|
|
#
|
|
|
|
# spec file for package python-CacheControl
|
|
|
|
#
|
2023-05-08 10:18:52 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2018-03-23 16:14:07 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-12-04 14:18:07 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-03-23 16:14:07 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-05-08 10:18:52 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2018-03-23 16:14:07 +01:00
|
|
|
Name: python-CacheControl
|
2022-08-02 15:26:59 +02:00
|
|
|
Version: 0.12.11
|
2018-03-23 16:14:07 +01:00
|
|
|
Release: 0
|
2020-01-02 14:46:19 +01:00
|
|
|
Summary: Caching library for Python requests
|
2018-03-23 16:14:07 +01:00
|
|
|
License: Apache-2.0
|
|
|
|
Group: Development/Languages/Python
|
2018-12-04 18:10:38 +01:00
|
|
|
URL: https://github.com/ionrock/cachecontrol
|
2020-01-02 14:46:19 +01:00
|
|
|
Source: https://github.com/ionrock/cachecontrol/archive/v%{version}.tar.gz#/CacheControl-%{version}.tar.gz
|
2018-03-23 16:14:07 +01:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
2018-12-04 18:10:38 +01:00
|
|
|
BuildRequires: python-rpm-macros
|
2021-12-04 23:32:27 +01:00
|
|
|
Requires: python-msgpack >= 0.5.2
|
2018-03-23 16:14:07 +01:00
|
|
|
Requires: python-requests
|
2021-12-04 23:32:27 +01:00
|
|
|
Provides: python-cachecontrol = %{version}-%{release}
|
2020-05-28 09:35:26 +02:00
|
|
|
Requires(post): update-alternatives
|
2021-12-04 23:32:27 +01:00
|
|
|
Requires(postun):update-alternatives
|
2019-03-25 10:50:55 +01:00
|
|
|
Recommends: python-lockfile >= 0.9
|
2018-03-23 16:14:07 +01:00
|
|
|
Suggests: python-redis >= 2.10.5
|
|
|
|
BuildArch: noarch
|
2018-12-04 18:10:38 +01:00
|
|
|
# SECTION test requirements
|
2021-12-04 23:32:27 +01:00
|
|
|
BuildRequires: %{python_module CherryPy}
|
|
|
|
BuildRequires: %{python_module lockfile >= 0.9}
|
|
|
|
BuildRequires: %{python_module msgpack >= 0.5.2}
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module redis >= 2.10.5}
|
|
|
|
BuildRequires: %{python_module requests}
|
2018-12-04 18:10:38 +01:00
|
|
|
# /SECTION
|
2018-03-23 16:14:07 +01:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2019-03-25 10:50:55 +01:00
|
|
|
CacheControl is a port of the caching algorithms in httplib2 for use with
|
|
|
|
requests session object.
|
2018-03-23 16:14:07 +01:00
|
|
|
|
|
|
|
%prep
|
2019-03-25 10:50:55 +01:00
|
|
|
%setup -q -n cachecontrol-%{version}
|
2021-12-04 23:32:27 +01:00
|
|
|
sed -i -e 's/^from mock/from unittest.mock/' -e 's/^import mock/from unittest import mock/' tests/*.py
|
2018-03-23 16:14:07 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
2020-05-28 09:35:26 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/doesitcache
|
2018-03-23 16:14:07 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
2019-03-25 10:50:55 +01:00
|
|
|
%check
|
2020-01-02 14:46:19 +01:00
|
|
|
# test_file_cache_recognizes_consumed_file_handle uses httpbin.org directly
|
2021-12-04 23:32:27 +01:00
|
|
|
%pytest -v -k 'not test_file_cache_recognizes_consumed_file_handle'
|
2019-03-25 10:50:55 +01:00
|
|
|
|
2020-05-28 09:35:26 +02:00
|
|
|
%post
|
|
|
|
%python_install_alternative doesitcache
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative doesitcache
|
|
|
|
|
2018-03-23 16:14:07 +01:00
|
|
|
%files %{python_files}
|
2018-12-04 18:10:38 +01:00
|
|
|
%license LICENSE.txt
|
|
|
|
%doc README.rst
|
2020-05-28 09:35:26 +02:00
|
|
|
%python_alternative %{_bindir}/doesitcache
|
2021-12-04 23:32:27 +01:00
|
|
|
%{python_sitelib}/cachecontrol
|
|
|
|
%{python_sitelib}/CacheControl-%{version}*-info
|
2018-03-23 16:14:07 +01:00
|
|
|
|
|
|
|
%changelog
|