2017-04-07 07:39:18 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-requests-cache
|
|
|
|
#
|
2021-04-12 12:39:42 +00:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2017-04-07 07:39:18 +00: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 13:59:26 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2017-04-07 07:39:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
Name: python-requests-cache
|
2021-04-12 12:39:42 +00:00
|
|
|
Version: 0.6.0
|
2017-04-07 07:39:18 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Persistent cache for requests library
|
2018-12-04 13:59:26 +00:00
|
|
|
License: BSD-2-Clause
|
2017-04-07 07:39:18 +00:00
|
|
|
Group: Development/Languages/Python
|
2018-12-04 17:21:03 +00:00
|
|
|
URL: https://github.com/reclosedev/requests-cache
|
2017-04-07 07:39:18 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/r/requests-cache/requests-cache-%{version}.tar.gz
|
2018-12-04 13:59:26 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-09-10 10:53:04 +00:00
|
|
|
BuildRequires: fdupes
|
2017-04-07 07:39:18 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2021-04-12 12:39:42 +00:00
|
|
|
Requires: itsdangerous
|
|
|
|
Requires: python-requests >= 2.0.0
|
|
|
|
Requires: url-normalize >= 1.4
|
2017-04-07 07:39:18 +00:00
|
|
|
BuildArch: noarch
|
2021-04-12 12:39:42 +00:00
|
|
|
# SECTION test requirements
|
|
|
|
BuildRequires: %{python_module gunicorn}
|
|
|
|
BuildRequires: %{python_module httpbin}
|
|
|
|
BuildRequires: %{python_module itsdangerous}
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module requests >= 2.0.0}
|
|
|
|
BuildRequires: %{python_module requests-mock}
|
|
|
|
BuildRequires: %{python_module url-normalize >= 1.4}
|
|
|
|
# /SECTION
|
2017-04-07 07:39:18 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2021-04-12 12:39:42 +00:00
|
|
|
Requests-cache is a transparent persistent cache for requests_ library.
|
2018-12-04 17:21:03 +00:00
|
|
|
|
2017-04-07 07:39:18 +00:00
|
|
|
It can be useful when you are creating some simple data scraper with constantly
|
|
|
|
changing parsing logic or data format, and don't want to redownload pages or
|
|
|
|
write complex error handling and persistence.
|
|
|
|
|
|
|
|
Requests-cache ignores all cache headers, it just caches the data for the
|
|
|
|
time you specify.
|
|
|
|
|
|
|
|
If you need library which knows how to use HTTP headers and status codes,
|
2021-04-12 12:39:42 +00:00
|
|
|
take a look at `CacheControl <https://github.com/ionrock/cachecontrol>`_.
|
2017-04-07 07:39:18 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n requests-cache-%{version}
|
2021-04-12 12:39:42 +00:00
|
|
|
sed -i '1{/^#!/d}' requests_cache/__init__.py
|
2017-04-07 07:39:18 +00:00
|
|
|
|
|
|
|
%build
|
2018-12-04 17:21:03 +00:00
|
|
|
%python_build
|
2017-04-07 07:39:18 +00:00
|
|
|
|
|
|
|
%install
|
2018-12-04 17:21:03 +00:00
|
|
|
%python_install
|
2021-04-12 12:39:42 +00:00
|
|
|
%{python_expand rm -r %{buildroot}%{$python_sitelib}/tests/
|
|
|
|
%fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
}
|
2017-04-07 07:39:18 +00:00
|
|
|
|
|
|
|
%check
|
2021-04-12 12:39:42 +00:00
|
|
|
gunicorn -b 127.0.0.1:8080 httpbin:app -k gevent &
|
|
|
|
export HTTPBIN_URL=http://localhost:8080/
|
|
|
|
%pytest
|
2017-04-07 07:39:18 +00:00
|
|
|
|
|
|
|
%files %{python_files}
|
2018-12-04 17:21:03 +00:00
|
|
|
%license LICENSE
|
2021-04-12 12:39:42 +00:00
|
|
|
%doc README.md HISTORY.md docs/*.rst
|
2017-04-07 07:39:18 +00:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
%changelog
|