requests-cache 1.2.0__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {requests_cache-1.2.0 → requests_cache-1.2.1}/CONTRIBUTORS.md +6 -4
- {requests_cache-1.2.0 → requests_cache-1.2.1}/HISTORY.md +9 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/PKG-INFO +1 -1
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/conf.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/expiration.md +2 -2
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/general.md +1 -1
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/matching.md +1 -1
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/troubleshooting.md +1 -1
- {requests_cache-1.2.0 → requests_cache-1.2.1}/pyproject.toml +6 -4
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/__init__.py +1 -1
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/_utils.py +2 -1
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/__init__.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/base.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/dynamodb.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/filesystem.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/gridfs.py +5 -4
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/mongodb.py +6 -5
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/redis.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/backends/sqlite.py +5 -4
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/cache_keys.py +2 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/models/__init__.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/models/response.py +6 -6
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/patcher.py +5 -3
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/policy/__init__.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/policy/expiration.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/serializers/__init__.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/serializers/cattrs.py +6 -4
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/serializers/pipeline.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/serializers/preconf.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/session.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/benchmark_serializers.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/compat/httpbin_sample.test-db +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/compat/test_requests_mock_combine_cache.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/compat/test_requests_mock_disable_cache.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/compat/test_requests_mock_load_cache.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/compat/test_responses_load_cache.py +4 -1
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/conftest.py +9 -2
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/generate_test_db.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/base_cache_test.py +9 -5
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/base_storage_test.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/test_base_cache.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/test_cache_keys.py +24 -8
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/test_session.py +1 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/.readthedocs.yml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/CONTRIBUTING.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/LICENSE +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/README.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docker-compose.yml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/404.rst +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/Dockerfile +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/dynamodb.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/dynamodb_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/dynamodb_create_table.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/dynamodb_items.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/dynamodb_response.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/favicon.ico +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-json.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-json_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-pickle.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-pickle_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-toml.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-toml_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-yaml.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-yaml_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/file-yaml_32px.png.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/files-generic.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/files-generic_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/files-json.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/files-json_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/memcached.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/memcached_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/memory_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/mongodb.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/mongodb_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/mongodb_vscode.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/redis.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/redis_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/requests-cache-gh-preview.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/requests-cache-icon.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/requests-cache-logo-dark.webp +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/requests-cache-logo-header.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/requests-cache-logo-light.webp +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/sqlite.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/sqlite_32px.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/table.css +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_static/toml.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_templates/module.rst_t +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/_templates/package.rst_t +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/api/requests_cache.session.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/docker-compose.yml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/examples.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/index.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/project_info/code_of_conduct.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/project_info/codeshelter.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/project_info/contributing.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/project_info/contributors.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/project_info/history.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/project_info/related_projects.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/project_info.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/reference.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/sample_data/sample_response_binary.json +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/sample_data/sample_response_binary.yaml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/sample_data/sample_response_json.json +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/sample_data/sample_response_json.yaml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/advanced_requests.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/backends/dynamodb.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/backends/filesystem.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/backends/gridfs.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/backends/mongodb.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/backends/redis.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/backends/sqlite.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/backends.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/compatibility.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/files.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/filtering.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/headers.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/inspection.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/installation.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/security.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide/serializers.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/user_guide.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/vector/requests-cache-logo-header.svg +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/vector/requests-cache-logo.svg +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/docs/vector/requests_cache_icon.svg +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/README.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/basic_patching.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/basic_sessions.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/benchmark.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/cloudformation.yml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/convert_cache.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/custom_request_matcher.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/expiration.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/external_config.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/external_config.yml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/generate_test_db.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/github_actions.yml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/log_requests.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/pygithub.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/rps_graph.png +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/rps_graph.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/threads.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/time_machine_backtesting.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/url_patterns.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/examples/vcr.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/models/base.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/models/raw_response.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/models/request.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/policy/actions.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/policy/directives.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/policy/settings.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/requests_cache/py.typed +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/README.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/__init__.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/compat/README.md +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/__init__.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/test_dynamodb.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/test_filesystem.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/test_memory.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/test_mongodb.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/test_redis.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/test_sqlite.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/integration/test_upgrade.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.3.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.4.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.4.13 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.5.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.5.1 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.5.2 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.6.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.6.1 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.6.2 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.6.3 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.6.4 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.7.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.7.1 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.7.2 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.7.3 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.7.4 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.7.5 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.8.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.8.1 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.1 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.2 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.3 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.4 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.5 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.6 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.7 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.0.9.8 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.1.0.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.1.1.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/sample.db.1.2.0 +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/vcr_requests_cache.yaml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/sample_data/vcr_vcrpy.yaml +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/models/test_base.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/models/test_raw_response.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/models/test_request.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/models/test_response.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/policy/test_actions.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/policy/test_expiration.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/test_patcher.py +0 -0
- {requests_cache-1.2.0 → requests_cache-1.2.1}/tests/unit/test_serializers.py +0 -0
|
@@ -11,7 +11,7 @@ contributions that have helped to improve requests-cache:
|
|
|
11
11
|
<tbody>
|
|
12
12
|
<tr>
|
|
13
13
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/amangean"><img src="https://avatars.githubusercontent.com/u/3106815?v=4?s=100" width="100px;" alt="A. Mangean"/><br /><sub><b>A. Mangean</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Aamangean" title="Bug reports">🐛</a></td>
|
|
14
|
-
<td align="center" valign="top" width="14.28%"><a href="https://meltano.com/"><img src="https://avatars.githubusercontent.com/u/18150651?v=4?s=100" width="100px;" alt="Aaron (
|
|
14
|
+
<td align="center" valign="top" width="14.28%"><a href="https://meltano.com/"><img src="https://avatars.githubusercontent.com/u/18150651?v=4?s=100" width="100px;" alt="Aaron ("AJ") Steers"/><br /><sub><b>Aaron ("AJ") Steers</b></sub></a><br /><a href="#ideas-aaronsteers" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
15
15
|
<td align="center" valign="top" width="14.28%"><a href="http://aljohri.com/"><img src="https://avatars.githubusercontent.com/u/2790092?v=4?s=100" width="100px;" alt="Al Johri"/><br /><sub><b>Al Johri</b></sub></a><br /><a href="#ideas-AlJohri" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
16
16
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/olk-m"><img src="https://avatars.githubusercontent.com/u/148966056?v=4?s=100" width="100px;" alt="Alessio"/><br /><sub><b>Alessio</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Aolk-m" title="Bug reports">🐛</a> <a href="https://github.com/requests-cache/requests-cache/commits?author=olk-m" title="Code">💻</a></td>
|
|
17
17
|
<td align="center" valign="top" width="14.28%"><a href="http://grep.ro/"><img src="https://avatars.githubusercontent.com/u/27617?v=4?s=100" width="100px;" alt="Alex Morega"/><br /><sub><b>Alex Morega</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=mgax" title="Documentation">📖</a> <a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Amgax" title="Bug reports">🐛</a></td>
|
|
@@ -115,27 +115,29 @@ contributions that have helped to improve requests-cache:
|
|
|
115
115
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/TheTechromancer"><img src="https://avatars.githubusercontent.com/u/20261699?v=4?s=100" width="100px;" alt="TheTechromancer"/><br /><sub><b>TheTechromancer</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3ATheTechromancer" title="Bug reports">🐛</a></td>
|
|
116
116
|
<td align="center" valign="top" width="14.28%"><a href="https://netomi.github.io/"><img src="https://avatars.githubusercontent.com/u/1048055?v=4?s=100" width="100px;" alt="Thomas Neidhart"/><br /><sub><b>Thomas Neidhart</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Anetomi" title="Bug reports">🐛</a> <a href="https://github.com/requests-cache/requests-cache/commits?author=netomi" title="Code">💻</a></td>
|
|
117
117
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ValueRaider"><img src="https://avatars.githubusercontent.com/u/96923577?v=4?s=100" width="100px;" alt="ValueRaider"/><br /><sub><b>ValueRaider</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=ValueRaider" title="Documentation">📖</a></td>
|
|
118
|
-
<td align="center" valign="top" width="14.28%"><a href="https://
|
|
118
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.thedataschool.com.au/the-team/vincent-ging-ho-yim/"><img src="https://avatars.githubusercontent.com/u/28189684?v=4?s=100" width="100px;" alt="Vincent Ging Ho Yim"/><br /><sub><b>Vincent Ging Ho Yim</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Acenviity" title="Bug reports">🐛</a> <a href="https://github.com/requests-cache/requests-cache/commits?author=cenviity" title="Code">💻</a></td>
|
|
119
119
|
</tr>
|
|
120
120
|
<tr>
|
|
121
|
+
<td align="center" valign="top" width="14.28%"><a href="https://vladimir.panteleev.md/"><img src="https://avatars.githubusercontent.com/u/160894?v=4?s=100" width="100px;" alt="Vladimir Panteleev"/><br /><sub><b>Vladimir Panteleev</b></sub></a><br /><a href="#ideas-CyberShadow" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
121
122
|
<td align="center" valign="top" width="14.28%"><a href="https://sansec.io/"><img src="https://avatars.githubusercontent.com/u/1145479?v=4?s=100" width="100px;" alt="Willem de Groot"/><br /><sub><b>Willem de Groot</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=gwillem" title="Code">💻</a> <a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Agwillem" title="Bug reports">🐛</a></td>
|
|
122
123
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/WouterVH"><img src="https://avatars.githubusercontent.com/u/469509?v=4?s=100" width="100px;" alt="Wouter Vanden Hove"/><br /><sub><b>Wouter Vanden Hove</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3AWouterVH" title="Bug reports">🐛</a></td>
|
|
123
124
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/YetAnotherNerd"><img src="https://avatars.githubusercontent.com/u/320738?v=4?s=100" width="100px;" alt="YetAnotherNerd"/><br /><sub><b>YetAnotherNerd</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=YetAnotherNerd" title="Code">💻</a> <a href="#feature-YetAnotherNerd" title="New features">✨</a> <a href="https://github.com/requests-cache/requests-cache/issues?q=author%3AYetAnotherNerd" title="Bug reports">🐛</a></td>
|
|
124
125
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aaron-mf1"><img src="https://avatars.githubusercontent.com/u/65560918?v=4?s=100" width="100px;" alt="aaron-mf1"/><br /><sub><b>aaron-mf1</b></sub></a><br /><a href="#ideas-aaron-mf1" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
125
126
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/coryairbhb"><img src="https://avatars.githubusercontent.com/u/50755629?v=4?s=100" width="100px;" alt="coryairbhb"/><br /><sub><b>coryairbhb</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Acoryairbhb" title="Bug reports">🐛</a></td>
|
|
126
127
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/craigls"><img src="https://avatars.githubusercontent.com/u/972350?v=4?s=100" width="100px;" alt="craig"/><br /><sub><b>craig</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=craigls" title="Code">💻</a> <a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Acraigls" title="Bug reports">🐛</a></td>
|
|
127
|
-
<td align="center" valign="top" width="14.28%"><a href="https://denes.omnipathdb.org/"><img src="https://avatars.githubusercontent.com/u/2679889?v=4?s=100" width="100px;" alt="deeenes"/><br /><sub><b>deeenes</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Adeeenes" title="Bug reports">🐛</a></td>
|
|
128
128
|
</tr>
|
|
129
129
|
<tr>
|
|
130
|
+
<td align="center" valign="top" width="14.28%"><a href="https://denes.omnipathdb.org/"><img src="https://avatars.githubusercontent.com/u/2679889?v=4?s=100" width="100px;" alt="deeenes"/><br /><sub><b>deeenes</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Adeeenes" title="Bug reports">🐛</a></td>
|
|
130
131
|
<td align="center" valign="top" width="14.28%"><a href="https://stackoverflow.com/users/86643/denis"><img src="https://avatars.githubusercontent.com/u/1280390?v=4?s=100" width="100px;" alt="denis-bz"/><br /><sub><b>denis-bz</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Adenis-bz" title="Bug reports">🐛</a></td>
|
|
131
132
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/eserdk"><img src="https://avatars.githubusercontent.com/u/16106844?v=4?s=100" width="100px;" alt="eserdk"/><br /><sub><b>eserdk</b></sub></a><br /><a href="#ideas-eserdk" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
132
133
|
<td align="center" valign="top" width="14.28%"><a href="https://gir.st/"><img src="https://avatars.githubusercontent.com/u/11820748?v=4?s=100" width="100px;" alt="girst"/><br /><sub><b>girst</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Agirst" title="Bug reports">🐛</a></td>
|
|
133
134
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gorogoroumaru"><img src="https://avatars.githubusercontent.com/u/30716350?v=4?s=100" width="100px;" alt="gorogoroumaru"/><br /><sub><b>gorogoroumaru</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=gorogoroumaru" title="Code">💻</a></td>
|
|
134
135
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gsalvatella"><img src="https://avatars.githubusercontent.com/u/42438361?v=4?s=100" width="100px;" alt="gsalvatella "/><br /><sub><b>gsalvatella </b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Agsalvatella" title="Bug reports">🐛</a></td>
|
|
135
136
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/harvey251"><img src="https://avatars.githubusercontent.com/u/33844174?v=4?s=100" width="100px;" alt="harvey251"/><br /><sub><b>harvey251</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Aharvey251" title="Bug reports">🐛</a></td>
|
|
136
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/masavini"><img src="https://avatars.githubusercontent.com/u/6315187?v=4?s=100" width="100px;" alt="masavini"/><br /><sub><b>masavini</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=masavini" title="Documentation">📖</a></td>
|
|
137
137
|
</tr>
|
|
138
138
|
<tr>
|
|
139
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jcd000"><img src="https://avatars.githubusercontent.com/u/8661795?v=4?s=100" width="100px;" alt="jcd000"/><br /><sub><b>jcd000</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Ajcd000" title="Bug reports">🐛</a> <a href="https://github.com/requests-cache/requests-cache/commits?author=jcd000" title="Code">💻</a></td>
|
|
140
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/masavini"><img src="https://avatars.githubusercontent.com/u/6315187?v=4?s=100" width="100px;" alt="masavini"/><br /><sub><b>masavini</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=masavini" title="Documentation">📖</a></td>
|
|
139
141
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mbarkhau"><img src="https://avatars.githubusercontent.com/u/446561?v=4?s=100" width="100px;" alt="mbarkhau"/><br /><sub><b>mbarkhau</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=mbarkhau" title="Code">💻</a> <a href="https://github.com/requests-cache/requests-cache/commits?author=mbarkhau" title="Tests">⚠️</a> <a href="#infra-mbarkhau" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Ambarkhau" title="Bug reports">🐛</a></td>
|
|
140
142
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/shiftinv"><img src="https://avatars.githubusercontent.com/u/8530778?v=4?s=100" width="100px;" alt="shiftinv"/><br /><sub><b>shiftinv</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/commits?author=shiftinv" title="Code">💻</a> <a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Ashiftinv" title="Bug reports">🐛</a></td>
|
|
141
143
|
<td align="center" valign="top" width="14.28%"><a href="https://www.witionstheme.com/"><img src="https://avatars.githubusercontent.com/u/55755139?v=4?s=100" width="100px;" alt="witionstheme"/><br /><sub><b>witionstheme</b></sub></a><br /><a href="https://github.com/requests-cache/requests-cache/issues?q=author%3Awitionstheme" title="Bug reports">🐛</a></td>
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# History
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
🪲 **Bugfixes:**
|
|
6
|
+
* Fix `normalize_headers` not accepting header values in bytes
|
|
7
|
+
* Fix inconsistency due to rounding in `CachedResponse.expires_unix` property
|
|
8
|
+
* Fix form boundary used for cached multipart requests to _fully_ comply with RFC 2046
|
|
9
|
+
* Fix loading cached JSON content with `decode_content=True` when the root element is an empty list or object
|
|
10
|
+
* Fix usage example with `responses` library to be compatible with `requests` 2.32
|
|
11
|
+
|
|
3
12
|
## 1.2.0 (2024-02-17)
|
|
4
13
|
|
|
5
14
|
⚠️ **Deprecations & removals:**
|
|
@@ -86,7 +86,7 @@ Examples:
|
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
**Notes:**
|
|
89
|
-
- `urls_expire_after` should be a dict in the format `{pattern
|
|
89
|
+
- `urls_expire_after` should be a dict in the format `{pattern: expire_after}`
|
|
90
90
|
- `expire_after` accepts the same types as `CachedSession.settings.expire_after`
|
|
91
91
|
- **Glob patterns** will match request **base URLs without the protocol**, so the pattern `site.com/resource/`
|
|
92
92
|
is equivalent to `http*://site.com/resource/**`.
|
|
@@ -140,7 +140,7 @@ expiration will only apply to new responses (including refreshes of expired resp
|
|
|
140
140
|
Options to apply a new expiration value include:
|
|
141
141
|
* Clearing the cache
|
|
142
142
|
* {ref}`Refreshing <refresh>` individual requests
|
|
143
|
-
* Use
|
|
143
|
+
* Use {py:meth}`.BaseCache.reset_expiration`:
|
|
144
144
|
```python
|
|
145
145
|
# Reset expiration for all responses to 30 days from now
|
|
146
146
|
>>> session.cache.reset_expiration(timedelta(days=30))
|
|
@@ -100,7 +100,7 @@ There are a number of settings that affect cache behavior, which are covered in
|
|
|
100
100
|
|
|
101
101
|
These can all be passed as keyword arguments to {py:class}`.CachedSession` or
|
|
102
102
|
{py:func}`.install_cache`. When using a session object, these can also be safely modified at any
|
|
103
|
-
time via {py:
|
|
103
|
+
time via {py:class}`CachedSession.settings <.CacheSettings>`. For example:
|
|
104
104
|
```python
|
|
105
105
|
>>> from requests_cache import CachedSession
|
|
106
106
|
|
|
@@ -121,7 +121,7 @@ session = CachedSession(key_fn=create_key)
|
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
`**kwargs` includes relevant {py:class}`.BaseCache` settings and any other keyword args passed to
|
|
124
|
-
{py:meth}`.CachedSession.send
|
|
124
|
+
{py:meth}`.CachedSession.send`. If you want use a custom matching function _and_ the existing
|
|
125
125
|
options `ignored_parameters` and `match_headers`, you can implement them in `key_fn`:
|
|
126
126
|
```python
|
|
127
127
|
def create_key(
|
|
@@ -67,7 +67,7 @@ Here are some error messages you may see either in the logs or (more rarely) in
|
|
|
67
67
|
usually means that a response was previously cached in a format that isn't compatible with the
|
|
68
68
|
current version of requests-cache or one of its dependencies.
|
|
69
69
|
* This message is to help with debugging and can generally be ignored. If you prefer, you can
|
|
70
|
-
either {py:meth}`~.BaseCache.
|
|
70
|
+
either {py:meth}`~.BaseCache.delete` the invalid responses or {py:meth}`~.BaseCache.clear` the
|
|
71
71
|
entire cache.
|
|
72
72
|
* **`Request for URL {url} failed; using cached response`:** This is just a notification that the
|
|
73
73
|
{ref}`stale_if_error <request-errors>` option is working as intended.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "requests-cache"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.1"
|
|
4
4
|
description = "A persistent cache for python requests"
|
|
5
5
|
authors = ["Roman Haritonov", "Jordan Cook"]
|
|
6
6
|
license = "BSD-2-Clause"
|
|
@@ -126,7 +126,7 @@ pytest-clarity = "^1.0.1"
|
|
|
126
126
|
pytest-cov = ">=3.0"
|
|
127
127
|
pytest-rerunfailures = ">=10.1"
|
|
128
128
|
pytest-xdist = ">=2.2"
|
|
129
|
-
requests-mock = "^1.
|
|
129
|
+
requests-mock = "^1.12"
|
|
130
130
|
responses = ">=0.19"
|
|
131
131
|
tenacity = "^8.0"
|
|
132
132
|
timeout-decorator = "^0.5"
|
|
@@ -186,14 +186,16 @@ fix = true
|
|
|
186
186
|
unsafe-fixes = true
|
|
187
187
|
line-length = 100
|
|
188
188
|
output-format = 'grouped'
|
|
189
|
-
select = ['B', 'C4', 'C90', 'E', 'F']
|
|
190
|
-
ignore = ['B023']
|
|
191
189
|
target-version = 'py38'
|
|
192
190
|
exclude = ['examples/']
|
|
193
191
|
|
|
194
192
|
[tool.ruff.format]
|
|
195
193
|
quote-style = 'single'
|
|
196
194
|
|
|
195
|
+
[tool.ruff.lint]
|
|
196
|
+
select = ['B', 'C4', 'C90', 'E', 'F']
|
|
197
|
+
ignore = ['B023']
|
|
198
|
+
|
|
197
199
|
[tool.ruff.lint.isort]
|
|
198
200
|
known-first-party = ['tests']
|
|
199
201
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Minor internal utility functions that don't really belong anywhere else"""
|
|
2
|
+
|
|
2
3
|
from contextlib import contextmanager
|
|
3
4
|
from inspect import signature
|
|
4
5
|
from logging import getLogger
|
|
@@ -6,7 +7,7 @@ from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tupl
|
|
|
6
7
|
|
|
7
8
|
from urllib3 import filepost
|
|
8
9
|
|
|
9
|
-
FORM_BOUNDARY = '
|
|
10
|
+
FORM_BOUNDARY = '--requests-cache-form-boundary--'
|
|
10
11
|
|
|
11
12
|
KwargDict = Dict[str, Any]
|
|
12
13
|
logger = getLogger('requests_cache')
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:classes-only:
|
|
5
5
|
:nosignatures:
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
from logging import getLogger
|
|
8
9
|
from threading import RLock
|
|
9
10
|
from typing import Optional
|
|
@@ -25,8 +26,8 @@ class GridFSCache(BaseCache):
|
|
|
25
26
|
|
|
26
27
|
Args:
|
|
27
28
|
db_name: Database name
|
|
28
|
-
connection: :py:class
|
|
29
|
-
kwargs: Additional keyword arguments for :py:class
|
|
29
|
+
connection: :py:class:`~pymongo.mongo_client.MongoClient` object to reuse instead of creating a new one
|
|
30
|
+
kwargs: Additional keyword arguments for :py:class:`~pymongo.mongo_client.MongoClient`
|
|
30
31
|
"""
|
|
31
32
|
|
|
32
33
|
def __init__(
|
|
@@ -59,8 +60,8 @@ class GridFSDict(BaseStorage):
|
|
|
59
60
|
Args:
|
|
60
61
|
db_name: Database name
|
|
61
62
|
collection_name: Ignored; GridFS internally uses collections 'fs.files' and 'fs.chunks'
|
|
62
|
-
connection: :py:class
|
|
63
|
-
kwargs: Additional keyword arguments for :py:class
|
|
63
|
+
connection: :py:class:`~pymongo.mongo_client.MongoClient` object to reuse instead of creating a new one
|
|
64
|
+
kwargs: Additional keyword arguments for :py:class:`~pymongo.mongo_client.MongoClient`
|
|
64
65
|
"""
|
|
65
66
|
|
|
66
67
|
def __init__(
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:classes-only:
|
|
5
5
|
:nosignatures:
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
from datetime import timedelta
|
|
8
9
|
from logging import getLogger
|
|
9
10
|
from typing import Iterable, Mapping, Optional, Union
|
|
@@ -21,12 +22,12 @@ logger = getLogger(__name__)
|
|
|
21
22
|
|
|
22
23
|
class MongoCache(BaseCache):
|
|
23
24
|
"""MongoDB cache backend.
|
|
24
|
-
By default, responses are
|
|
25
|
+
By default, responses are partially serialized into a MongoDB-compatible document format.
|
|
25
26
|
|
|
26
27
|
Args:
|
|
27
28
|
db_name: Database name
|
|
28
|
-
connection: :py:class
|
|
29
|
-
kwargs: Additional keyword arguments for :py:class
|
|
29
|
+
connection: :py:class:`~pymongo.mongo_client.MongoClient` object to reuse instead of creating a new one
|
|
30
|
+
kwargs: Additional keyword arguments for :py:class:`~pymongo.mongo_client.MongoClient`
|
|
30
31
|
"""
|
|
31
32
|
|
|
32
33
|
def __init__(
|
|
@@ -75,8 +76,8 @@ class MongoDict(BaseStorage):
|
|
|
75
76
|
Args:
|
|
76
77
|
db_name: Database name
|
|
77
78
|
collection_name: Collection name
|
|
78
|
-
connection: :py:class
|
|
79
|
-
kwargs: Additional keyword arguments for :py:class
|
|
79
|
+
connection: :py:class:`~pymongo.mongo_client.MongoClient` object to reuse instead of creating a new one
|
|
80
|
+
kwargs: Additional keyword arguments for :py:class:`~pymongo.mongo_client.MongoClient`
|
|
80
81
|
"""
|
|
81
82
|
|
|
82
83
|
def __init__(
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:classes-only:
|
|
5
5
|
:nosignatures:
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
import sqlite3
|
|
8
9
|
import threading
|
|
9
10
|
from contextlib import contextmanager
|
|
@@ -36,7 +37,7 @@ class SQLiteCache(BaseCache):
|
|
|
36
37
|
|
|
37
38
|
Args:
|
|
38
39
|
db_path: Database file path
|
|
39
|
-
use_cache_dir: Store
|
|
40
|
+
use_cache_dir: Store database in a user cache directory (e.g., `~/.cache/http_cache.sqlite`)
|
|
40
41
|
use_temp: Store database in a temp directory (e.g., ``/tmp/http_cache.sqlite``)
|
|
41
42
|
use_memory: Store database in memory instead of in a file
|
|
42
43
|
busy_timeout: Timeout in milliseconds for SQLite to wait if a table is locked.
|
|
@@ -84,7 +85,7 @@ class SQLiteCache(BaseCache):
|
|
|
84
85
|
self.responses.init_db()
|
|
85
86
|
self.redirects.init_db()
|
|
86
87
|
|
|
87
|
-
# A more efficient SQLite implementation of
|
|
88
|
+
# A more efficient SQLite implementation of BaseCache.delete
|
|
88
89
|
def delete(
|
|
89
90
|
self,
|
|
90
91
|
*keys: str,
|
|
@@ -152,7 +153,7 @@ class SQLiteCache(BaseCache):
|
|
|
152
153
|
"""
|
|
153
154
|
return self.responses.count(expired=expired)
|
|
154
155
|
|
|
155
|
-
# A more efficient implementation of
|
|
156
|
+
# A more efficient implementation of BaseCache.filter to make use of indexes
|
|
156
157
|
def filter(
|
|
157
158
|
self,
|
|
158
159
|
valid: bool = True,
|
|
@@ -167,7 +168,7 @@ class SQLiteCache(BaseCache):
|
|
|
167
168
|
valid=valid, expired=expired, invalid=invalid, older_than=older_than
|
|
168
169
|
)
|
|
169
170
|
|
|
170
|
-
# A more efficient implementation of
|
|
171
|
+
# A more efficient implementation of BaseCache.recreate_keys
|
|
171
172
|
def recreate_keys(self):
|
|
172
173
|
with self.responses.bulk_commit():
|
|
173
174
|
super().recreate_keys()
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:functions-only:
|
|
5
5
|
:nosignatures:
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
from __future__ import annotations
|
|
8
9
|
|
|
9
10
|
import json
|
|
@@ -133,6 +134,7 @@ def normalize_headers(
|
|
|
133
134
|
headers: MutableMapping[str, str], ignored_parameters: ParamList = None
|
|
134
135
|
) -> CaseInsensitiveDict:
|
|
135
136
|
"""Sort and filter request headers, and normalize minor variations in multi-value headers"""
|
|
137
|
+
headers = {k: decode(v) for (k, v) in headers.items()}
|
|
136
138
|
if ignored_parameters:
|
|
137
139
|
headers = filter_sort_dict(headers, ignored_parameters)
|
|
138
140
|
for k, v in headers.items():
|
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from datetime import datetime, timedelta
|
|
4
4
|
from logging import getLogger
|
|
5
|
-
from time import time
|
|
6
5
|
from typing import TYPE_CHECKING, Dict, List, Optional, Union
|
|
7
6
|
|
|
8
7
|
import attr
|
|
@@ -144,8 +143,9 @@ class CachedResponse(RichMixin, BaseResponse):
|
|
|
144
143
|
@property
|
|
145
144
|
def expires_unix(self) -> Optional[int]:
|
|
146
145
|
"""Get expiration time as a Unix timestamp"""
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
if self.expires is None:
|
|
147
|
+
return None
|
|
148
|
+
return round(self.expires.timestamp())
|
|
149
149
|
|
|
150
150
|
@property
|
|
151
151
|
def from_cache(self) -> bool:
|
|
@@ -187,10 +187,10 @@ class CachedResponse(RichMixin, BaseResponse):
|
|
|
187
187
|
|
|
188
188
|
def __str__(self):
|
|
189
189
|
return (
|
|
190
|
-
f'<CachedResponse [{self.status_code}]: '
|
|
191
|
-
f
|
|
190
|
+
f'<CachedResponse [{self.status_code}]: "'
|
|
191
|
+
f"created: {format_datetime(self.created_at)}, "
|
|
192
192
|
f'expires: {format_datetime(self.expires)} ({"stale" if self.is_expired else "fresh"}), '
|
|
193
|
-
f
|
|
193
|
+
f"size: {format_file_size(self.size)}, request: {self.request}>"
|
|
194
194
|
)
|
|
195
195
|
|
|
196
196
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"""Utilities for patching ``requests``. See :ref:`patching` for general usage info.
|
|
2
2
|
|
|
3
|
-
.. warning::
|
|
4
|
-
|
|
3
|
+
.. warning::
|
|
4
|
+
These functions are not thread-safe. Use :py:class:`.CachedSession` if you want to use caching
|
|
5
|
+
in a multi-threaded environment.
|
|
5
6
|
|
|
6
7
|
.. automodsumm:: requests_cache.patcher
|
|
7
8
|
:functions-only:
|
|
8
9
|
:nosignatures:
|
|
9
10
|
"""
|
|
11
|
+
|
|
10
12
|
from contextlib import contextmanager
|
|
11
13
|
from logging import getLogger
|
|
12
14
|
from typing import Optional, Type
|
|
@@ -108,7 +110,7 @@ def clear():
|
|
|
108
110
|
|
|
109
111
|
def delete(*args, **kwargs):
|
|
110
112
|
"""Remove responses from the cache according one or more conditions.
|
|
111
|
-
See :py:meth:`.BaseCache.delete for usage details.
|
|
113
|
+
See :py:meth:`.BaseCache.delete` for usage details.
|
|
112
114
|
"""
|
|
113
115
|
session = requests.Session()
|
|
114
116
|
if isinstance(session, CachedSession):
|
|
@@ -18,6 +18,7 @@ For example, for JSON:
|
|
|
18
18
|
For any optional libraries that aren't installed, the corresponding serializer will be a placeholder
|
|
19
19
|
class that raises an ``ImportError`` at initialization time instead of at import time.
|
|
20
20
|
"""
|
|
21
|
+
|
|
21
22
|
# ruff: noqa: F401
|
|
22
23
|
from typing import Optional, Union
|
|
23
24
|
|
|
@@ -11,22 +11,24 @@ serialization formats.
|
|
|
11
11
|
:functions-only:
|
|
12
12
|
:nosignatures:
|
|
13
13
|
"""
|
|
14
|
+
|
|
14
15
|
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
from collections.abc import MutableMapping
|
|
15
18
|
from datetime import datetime, timedelta
|
|
16
19
|
from decimal import Decimal
|
|
20
|
+
from functools import singledispatchmethod
|
|
17
21
|
from json import JSONDecodeError
|
|
18
22
|
from typing import Callable, Dict, ForwardRef, List, Optional, Union
|
|
19
|
-
from functools import singledispatchmethod
|
|
20
|
-
from collections.abc import MutableMapping
|
|
21
23
|
|
|
22
24
|
from cattrs import Converter
|
|
23
25
|
from requests.cookies import RequestsCookieJar, cookiejar_from_dict
|
|
24
26
|
from requests.exceptions import RequestException
|
|
25
27
|
from requests.structures import CaseInsensitiveDict
|
|
26
28
|
|
|
29
|
+
from .._utils import is_json_content_type
|
|
27
30
|
from ..models import CachedResponse, DecodedContent
|
|
28
31
|
from .pipeline import Stage
|
|
29
|
-
from .._utils import is_json_content_type
|
|
30
32
|
|
|
31
33
|
try:
|
|
32
34
|
import ujson as json
|
|
@@ -185,7 +187,7 @@ def _encode_content(response: CachedResponse) -> CachedResponse:
|
|
|
185
187
|
This has no effect for a binary response body.
|
|
186
188
|
"""
|
|
187
189
|
# The response may have previously been saved with `decode_content=False`
|
|
188
|
-
if
|
|
190
|
+
if response._decoded_content is None:
|
|
189
191
|
return response
|
|
190
192
|
|
|
191
193
|
# Encode body as JSON
|
|
Binary file
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Example of using requests-cache with the responses library"""
|
|
2
|
+
|
|
2
3
|
from contextlib import contextmanager
|
|
3
4
|
from os.path import dirname, join
|
|
4
5
|
from unittest.mock import patch
|
|
@@ -43,7 +44,9 @@ def get_responses():
|
|
|
43
44
|
|
|
44
45
|
# responses patches HTTPAdapter.send(), so we need to patch one level lower to verify request mocking
|
|
45
46
|
@patch.object(
|
|
46
|
-
requests.adapters.HTTPAdapter,
|
|
47
|
+
requests.adapters.HTTPAdapter,
|
|
48
|
+
'get_connection_with_tls_context',
|
|
49
|
+
side_effect=ValueError('Real request made!'),
|
|
47
50
|
)
|
|
48
51
|
def test_mock_session(mock_http_adapter):
|
|
49
52
|
"""Test that the mock_session fixture is working as expected"""
|
|
@@ -8,6 +8,7 @@ Note: The protocol ``http(s)+mock://`` helps :py:class:`requests_mock.Adapter` p
|
|
|
8
8
|
:py:class:`requests.PreparedRequest`. More info here:
|
|
9
9
|
https://requests-mock.readthedocs.io/en/latest/adapter.html
|
|
10
10
|
"""
|
|
11
|
+
|
|
11
12
|
import os
|
|
12
13
|
import platform
|
|
13
14
|
import warnings
|
|
@@ -28,7 +29,13 @@ from requests_mock import Adapter
|
|
|
28
29
|
from rich.logging import RichHandler
|
|
29
30
|
from timeout_decorator import timeout
|
|
30
31
|
|
|
31
|
-
from requests_cache import
|
|
32
|
+
from requests_cache import (
|
|
33
|
+
ALL_METHODS,
|
|
34
|
+
CachedSession,
|
|
35
|
+
install_cache,
|
|
36
|
+
uninstall_cache,
|
|
37
|
+
utcnow,
|
|
38
|
+
)
|
|
32
39
|
|
|
33
40
|
# ignore missing time-travel library on PyPy
|
|
34
41
|
try:
|
|
@@ -331,7 +338,7 @@ def skip_missing_deps(module_name: str) -> pytest.Mark:
|
|
|
331
338
|
|
|
332
339
|
@contextmanager
|
|
333
340
|
def ignore_deprecation():
|
|
334
|
-
"""Temporarily
|
|
341
|
+
"""Temporarily silence deprecation warnings"""
|
|
335
342
|
with warnings.catch_warnings():
|
|
336
343
|
warnings.simplefilter('ignore', category=DeprecationWarning)
|
|
337
344
|
yield
|