From 740a1d6233cf1a76927de22c34ddf2abf01ce76711ff2fc90050509554034f1a Mon Sep 17 00:00:00 2001 From: Nico Krapp Date: Fri, 15 Nov 2024 12:04:11 +0000 Subject: [PATCH] - Add missing runtime dependency OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-requests-cache?expand=0&rev=24 --- .gitattributes | 23 +++++ .gitignore | 1 + python-requests-cache.changes | 179 ++++++++++++++++++++++++++++++++++ python-requests-cache.spec | 97 ++++++++++++++++++ requests-cache-1.2.1.tar.gz | 3 + 5 files changed, 303 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-requests-cache.changes create mode 100644 python-requests-cache.spec create mode 100644 requests-cache-1.2.1.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-requests-cache.changes b/python-requests-cache.changes new file mode 100644 index 0000000..e5229a4 --- /dev/null +++ b/python-requests-cache.changes @@ -0,0 +1,179 @@ +------------------------------------------------------------------- +Fri Nov 15 11:25:16 UTC 2024 - Markéta Machová + +- Add missing runtime dependency + +------------------------------------------------------------------- +Thu Jun 20 12:49:34 UTC 2024 - Dirk Müller + +- update to 1.2.1: + * Fix normalize_headers not accepting header values in bytes + * Fix inconsistency due to rounding in + CachedResponse.expires_unix property + * Fix form boundary used for cached multipart requests to fully + comply with RFC 2046 + * Fix loading cached JSON content with decode_content=True when + the root element is an empty list or object + * Fix usage example with responses library to be compatible + with requests 2.32 + +------------------------------------------------------------------- +Wed Mar 13 10:16:28 UTC 2024 - Dirk Müller + +- update to 1.2.0: + * Drop support for python 3.7 + * Remove methods deprecated in 1.0 from `CachedSession` and + `BaseCache` + * Add support for `X-HTTP-Method-Override` and other headers + that can override request method + * Add `CachedSession.wrap()` classmethod to add caching to an + existing `requests.Session` object + * Add `vacuum` parameter to `SQLiteCache.delete()` to + optionally skip vacuuming after deletion (enabled by default + to free up disk space) + * Optimize `SQLiteCache.delete()` when deleting a single key + * Add support for RFC 7159 JSON body with `decode_content=True` + (root element with any type) + * Use timezone-aware UTC datetimes for all internal expiration + values + * Add support for python 3.12 + * Note: There is a known bug with multiprocess/multithreaded + usage of the SQLite backend on python 3.12. + * Add support for cattrs 23.2 + * Fix `IncompleteRead` error that could sometimes occur with + streaming requests due to mismatch with `Content-Length` + header + * Handle a corner case with streaming requests, conditional + requests, and redirects + * When redacting ignored parameters from a cached response, + keep the rest of the original URL and headers without + normalizing + * Add `CachedHTTPResponse._request_url` property for + compatibility with urllib3 + * Fix form boundary used for cached multipart requests to + comply with RFC 2046 + * If an explicit CA bundle path is passed via `verify` param, + cache the response under the same key as `verify=True` + * Handle JSON Content-Type charsets and MIME type variations + (such as `application/vnd.api+json`) during request + normalization and serialization + +------------------------------------------------------------------- +Tue Nov 21 06:22:09 UTC 2023 - Matej Cepl + +- Update to 1.1.1: + - Backport fix from 1.2: Add compatibility with cattrs 23.2 +- Update to 1.1.0: + - SESSION SETTINGS: + - Add support for regular expressions with urls_expire_after + - SQLITE BACKEND: + - Add busy_timeout argument (see SQLite docs for details) + - In WAL journaling mode (wal=True), default to 'normal' + synchronous mode instead of 'full' + - Fix potential OperationalError: database is locked in + multithreaded SQLite usage during bulk delete operations + - Fix deadlock in multithreaded SQLite usage if a thread + encounters an error during COMMIT + - BUGFIXES: + - Fix loading cached JSON content with decode_content=True + when the root element is a list + - Fix BaseCache.recreate_keys() to normalize response bodies + with b'None' + - Fix BaseCache.contains() for multipart POST requests + - Fix CachedResponse.history not being fully deserialized on + python<=3.8 + - Fix request matching with Vary and redirects + - Skip normalizing CachedResponse.url so it always matches + the original request URL + - Avoid unnecessary cache writes for revalidation requests if + headers and expiration are unchanged + - Add compatibility with urllib3 2.0 + +------------------------------------------------------------------- +Thu May 4 20:20:19 UTC 2023 - Matej Cepl + +- WORK IN PROGRESS, TESTS DON’T PASS! +- Update to 1.0.1: (CONGRATULATIONS!) + - Ignore Cache-Control: must-revalidate and no-cache when + `cache_control=False` + - Lots of miscellaneous performance improvements + - Fast automatic cache cleanup with TTL integration for + MongoDB, DynamoDB and Redis + - Improved NoSQL/document database support: human-readable and + indexable response data in MongoDB and DynamoDB + - Complete support for Cache-Control headers (including its + extensions) + - Complete type hinting and more details from cached responses + - Redact common authentication headers and parameters from the + cache by default + - Improved session settings interface, and more settings for + refreshing, revalidation, and offline cache usage +- Remaining list of changes all the way to 0.6.3 is too long, + HISTORY.md is packaged. + +------------------------------------------------------------------- +Sat Apr 24 11:30:00 UTC 2021 - John Vandenberg + +- Update to v0.6.3 + * Fix false positive warning with `include_get_headers` + * Fix handling of `decode_content` parameter for + `CachedResponse.raw.read()` + * Replace deprecated pymongo `Collection.count()` with + `estimated_document_count()` + +------------------------------------------------------------------- +Wed Apr 14 22:46:16 UTC 2021 - John Vandenberg + +- Fix runtime Requires, adding missing prefix python- +- Add Recommends python-redis and Suggests for python-boto3 and + python-mongodb +- Activate integration tests, including redis +- Update to v0.6.2 + * Explicitly include docs, tests, and examples in sdist +- from v0.6.1 + * Handle errors due to invalid responses in BaseCache.urls + * Add recently renamed BaseCache.remove_old_entries() back, as an + alias with a DeprecationWarning + * Make parent dirs for new SQLite databases + * Add aws_access_key_id and aws_secret_access_key kwargs to + DynamoDbDict + * Update GridFSPickleDict.__delitem__ to raise a KeyError for + missing items + * Demote most logging.info statements to debug level + * Exclude test directory from find_packages() + * Make integration tests easier to run and/or fail more quickly in + environments where Docker isn't available + +------------------------------------------------------------------- +Sat Apr 10 04:33:50 UTC 2021 - John Vandenberg + +- Update to v0.6.0 + * See https://github.com/reclosedev/requests-cache/blob/master/HISTORY.md + +------------------------------------------------------------------- +Tue Sep 10 10:50:37 UTC 2019 - Tomáš Chvátal + +- Update to 0.5.2: + * Fix DeprecationWarning from collections #140 + +------------------------------------------------------------------- +Tue May 7 12:27:11 UTC 2019 - pgajdos@suse.com + +- version update to 0.5.0 + * Add gridfs support, thanks to @chengguangnan + * Add dynamodb support, thanks to @ar90n + * Add response filter #104, thanks to @christopher-dG + * Fix bulk_commit #78 + * Fix remove_expired_responses missed in __init__.py #93 + * Fix deprecation warnings #122, thanks to mbarkhau + +------------------------------------------------------------------- +Tue Dec 4 12:53:42 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Tue Mar 28 17:27:40 UTC 2017 - alarrosa@suse.com + +- Initial release + diff --git a/python-requests-cache.spec b/python-requests-cache.spec new file mode 100644 index 0000000..8bfd2cd --- /dev/null +++ b/python-requests-cache.spec @@ -0,0 +1,97 @@ +# +# spec file for package python-requests-cache +# +# Copyright (c) 2024 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/ +# + + +Name: python-requests-cache +Version: 1.2.1 +Release: 0 +Summary: Persistent cache for requests library +License: BSD-2-Clause +Group: Development/Languages/Python +URL: https://github.com/requests-cache/requests-cache +Source: https://github.com/requests-cache/requests-cache/archive/refs/tags/v%{version}.tar.gz#/requests-cache-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module poetry-core} +BuildRequires: fdupes +BuildRequires: psmisc +BuildRequires: python-rpm-macros +Requires: python-cattrs +Requires: python-itsdangerous +Requires: python-requests >= 2.0.0 +Requires: python-url-normalize >= 1.4 +Recommends: python-redis +Suggests: python-boto3 +Suggests: python-mongodb +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module cattrs} +BuildRequires: %{python_module gunicorn} +BuildRequires: %{python_module httpbin} +BuildRequires: %{python_module itsdangerous} +BuildRequires: %{python_module platformdirs} +BuildRequires: %{python_module pymongo} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module redis} +BuildRequires: %{python_module requests >= 2.0.0} +BuildRequires: %{python_module requests-mock} +BuildRequires: %{python_module responses} +BuildRequires: %{python_module rich} +BuildRequires: %{python_module tenacity} +BuildRequires: %{python_module time-machine} +BuildRequires: %{python_module timeout-decorator} +BuildRequires: %{python_module url-normalize >= 1.4} +BuildRequires: redis +# /SECTION +%python_subpackages + +%description +Requests-cache is a transparent persistent cache for requests_ library. + +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, +take a look at `CacheControl `_. + +%prep +%setup -q -n requests-cache-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +gunicorn -b 127.0.0.1:8080 httpbin:app -k gevent & +%{_sbindir}/redis-server & +export HTTPBIN_URL=http://localhost:8080/ +%pytest -k 'not (dynamodb or gridfs or mongodb)' +killall -w redis-server + +%files %{python_files} +%license LICENSE +%doc README.md HISTORY.md docs/*.rst +%{python_sitelib}/requests_cache +%{python_sitelib}/requests_cache-%{version}*-info + +%changelog diff --git a/requests-cache-1.2.1.tar.gz b/requests-cache-1.2.1.tar.gz new file mode 100644 index 0000000..b4ed32c --- /dev/null +++ b/requests-cache-1.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5121eebd8a84c67368165778a23c4791cded96305e1daa231f3cb618730b3354 +size 3056882