summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook.git@proton.me>2022-12-04 13:05:47 -0600
committerJordan Cook <jordan.cook.git@proton.me>2022-12-13 16:27:49 -0600
commitca26b146592e08ff237cf9b6cccdba56eb2af484 (patch)
tree499d8679d07c70012d06f8fa3e1874ca59b83a65
parent01e9ba6d04c85157a6fa089ad5f49450270cf610 (diff)
parenta23bbd8a5da0e0f7ffd548e18d53000198836700 (diff)
downloadrequests-cache-ca26b146592e08ff237cf9b6cccdba56eb2af484.tar.gz
Merge pull request #736 from requests-cache/docs
Misc updates to docs, tests, and dependencies
-rw-r--r--.pre-commit-config.yaml10
-rw-r--r--HISTORY.md4
-rw-r--r--docs/user_guide/inspection.md7
-rw-r--r--pyproject.toml4
-rw-r--r--setup.cfg15
5 files changed, 27 insertions, 13 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 438183a..6eb48f0 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.3.0
+ rev: v4.4.0
hooks:
- id: check-toml
- id: check-yaml
@@ -9,20 +9,20 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
- rev: 22.6.0
+ rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
hooks:
- id: isort
- - repo: https://gitlab.com/pycqa/flake8
- rev: 3.9.2
+ - repo: https://github.com/pycqa/flake8
+ rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-comprehensions]
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v0.971
+ rev: v0.982
hooks:
- id: mypy
files: requests_cache
diff --git a/HISTORY.md b/HISTORY.md
index 040c0f1..7737f56 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -142,7 +142,7 @@ If you encounter a problem not listed here after updating to 1.0, please create
* Internal utility module changes:
* The `cache_control` module (added in `0.7`) has been split up into multiple modules in a new `policy` subpackage
-## 0.9.7 (2022-10-26)
+### 0.9.7 (2022-10-26)
Backport compatibility fixes from 1.0:
* **PyInstaller:** Fix potential `AttributeError` due to undetected imports when requests-cache is bundled in a PyInstaller package
* **requests-oauthlib:** Add support for header values as bytes for compatibility with OAuth1 features
@@ -158,7 +158,7 @@ Add the following for forwards-compatibility with 1.0:
* `BaseCache.filter()`
* `CachedSession.settings`
-## 0.9.6 (2022-08-24)
+### 0.9.6 (2022-08-24)
Backport fixes from 1.0:
* Remove potentially problematic row count from `BaseCache.__str__()`
* Remove upper version constraints for all non-dev dependencies
diff --git a/docs/user_guide/inspection.md b/docs/user_guide/inspection.md
index 9f9991e..339afba 100644
--- a/docs/user_guide/inspection.md
+++ b/docs/user_guide/inspection.md
@@ -94,8 +94,13 @@ You can use {py:meth}`.BaseCache.urls` to see all URLs currently in the cache:
['https://httpbin.org/get', 'https://httpbin.org/stream/100']
```
+### Other response details
If needed, you can access all responses via `CachedSession.cache.responses`, which is a dict-like
-interface to the cache backend. For example, if you wanted to to see all URLs requested with a specific method:
+interface to the cache backend, where:
+* Keys are cache keys (a hash of matched request information)
+* Values are {py:class}`.CachedResponse` objects
+
+For example, if you wanted to see URLs only for `POST` requests:
```python
>>> post_urls = [
... response.url for response in session.cache.responses.values()
diff --git a/pyproject.toml b/pyproject.toml
index 51a78a7..e56557c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -24,6 +24,10 @@ include = [
{format="sdist", path="tests"},
]
+[tool.poetry.urls]
+"Changelog" = "https://requests-cache.readthedocs.io/en/stable/project_info/history.html"
+"Issues" = "https://github.com/requests-cache/requests-cache/issues"
+
[tool.poetry.dependencies]
python = "^3.7" # requests requires python >=3.7, <4.0
diff --git a/setup.cfg b/setup.cfg
index 5a88bef..843f922 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,8 +4,13 @@ select = E,F,W,C4,C90
exclude = __pycache__,.tox,.venv,build,dist
# Defer these rules to black:
ignore =
- E203 # whitespace before ':'
- E225 # missing whitespace around operator
- E501 # line too long
- W503 # line break before binary operator
- W504 # line break after binary operator
+ # whitespace before ':'
+ E203
+ # missing whitespace around operator
+ E225
+ # line too long
+ E501
+ # line break before binary operator
+ W503
+ # line break after binary operator
+ W504