CacheControl 0.14.0__py3-none-any.whl → 0.14.1__py3-none-any.whl
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.
- cachecontrol/__init__.py +2 -1
- cachecontrol/adapter.py +2 -2
- cachecontrol/cache.py +1 -0
- cachecontrol/caches/file_cache.py +1 -1
- cachecontrol/controller.py +1 -0
- cachecontrol/filewrapper.py +2 -2
- cachecontrol/heuristics.py +4 -1
- {cachecontrol-0.14.0.dist-info → cachecontrol-0.14.1.dist-info}/METADATA +11 -10
- cachecontrol-0.14.1.dist-info/RECORD +18 -0
- {cachecontrol-0.14.0.dist-info → cachecontrol-0.14.1.dist-info}/WHEEL +1 -1
- cachecontrol-0.14.0.dist-info/RECORD +0 -18
- {cachecontrol-0.14.0.dist-info → cachecontrol-0.14.1.dist-info}/LICENSE.txt +0 -0
- {cachecontrol-0.14.0.dist-info → cachecontrol-0.14.1.dist-info}/entry_points.txt +0 -0
cachecontrol/__init__.py
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
Make it easy to import from cachecontrol without long namespaces.
|
|
8
8
|
"""
|
|
9
|
+
|
|
9
10
|
__author__ = "Eric Larson"
|
|
10
11
|
__email__ = "eric@ionrock.org"
|
|
11
|
-
__version__ = "0.14.
|
|
12
|
+
__version__ = "0.14.1"
|
|
12
13
|
|
|
13
14
|
from cachecontrol.adapter import CacheControlAdapter
|
|
14
15
|
from cachecontrol.controller import CacheController
|
cachecontrol/adapter.py
CHANGED
|
@@ -77,7 +77,7 @@ class CacheControlAdapter(HTTPAdapter):
|
|
|
77
77
|
|
|
78
78
|
return resp
|
|
79
79
|
|
|
80
|
-
def build_response(
|
|
80
|
+
def build_response( # type: ignore[override]
|
|
81
81
|
self,
|
|
82
82
|
request: PreparedRequest,
|
|
83
83
|
response: HTTPResponse,
|
|
@@ -143,7 +143,7 @@ class CacheControlAdapter(HTTPAdapter):
|
|
|
143
143
|
_update_chunk_length, response
|
|
144
144
|
)
|
|
145
145
|
|
|
146
|
-
resp: Response = super().build_response(request, response)
|
|
146
|
+
resp: Response = super().build_response(request, response)
|
|
147
147
|
|
|
148
148
|
# See if we should invalidate the cache.
|
|
149
149
|
if request.method in self.invalidating_methods and resp.ok:
|
cachecontrol/cache.py
CHANGED
|
@@ -6,7 +6,7 @@ from __future__ import annotations
|
|
|
6
6
|
import hashlib
|
|
7
7
|
import os
|
|
8
8
|
from textwrap import dedent
|
|
9
|
-
from typing import IO, TYPE_CHECKING
|
|
9
|
+
from typing import IO, TYPE_CHECKING
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
12
|
from cachecontrol.cache import BaseCache, SeparateBodyBaseCache
|
cachecontrol/controller.py
CHANGED
cachecontrol/filewrapper.py
CHANGED
|
@@ -38,10 +38,10 @@ class CallbackFileWrapper:
|
|
|
38
38
|
self.__callback = callback
|
|
39
39
|
|
|
40
40
|
def __getattr__(self, name: str) -> Any:
|
|
41
|
-
# The
|
|
41
|
+
# The vagaries of garbage collection means that self.__fp is
|
|
42
42
|
# not always set. By using __getattribute__ and the private
|
|
43
43
|
# name[0] allows looking up the attribute value and raising an
|
|
44
|
-
# AttributeError when it doesn't exist. This stop
|
|
44
|
+
# AttributeError when it doesn't exist. This stop things from
|
|
45
45
|
# infinitely recursing calls to getattr in the case where
|
|
46
46
|
# self.__fp hasn't been set.
|
|
47
47
|
#
|
cachecontrol/heuristics.py
CHANGED
|
@@ -68,7 +68,10 @@ class OneDayCache(BaseHeuristic):
|
|
|
68
68
|
|
|
69
69
|
if "expires" not in response.headers:
|
|
70
70
|
date = parsedate(response.headers["date"])
|
|
71
|
-
expires = expire_after(
|
|
71
|
+
expires = expire_after(
|
|
72
|
+
timedelta(days=1),
|
|
73
|
+
date=datetime(*date[:6], tzinfo=timezone.utc), # type: ignore[index,misc]
|
|
74
|
+
)
|
|
72
75
|
headers["expires"] = datetime_to_header(expires)
|
|
73
76
|
headers["cache-control"] = "public"
|
|
74
77
|
return headers
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: CacheControl
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.1
|
|
4
4
|
Summary: httplib2 caching for requests
|
|
5
5
|
Keywords: requests,http,caching,web
|
|
6
6
|
Author-email: Eric Larson <ericlarson@ionrock.com>, Frost Ming <me@frostming.com>, William Woodruff <william@yossarian.net>
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.8
|
|
8
8
|
Description-Content-Type: text/x-rst
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Environment :: Web Environment
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.8
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Topic :: Internet :: WWW/HTTP
|
|
20
20
|
Requires-Dist: requests >= 2.16.0
|
|
21
21
|
Requires-Dist: msgpack >= 0.5.2, < 2.0.0
|
|
22
|
-
Requires-Dist: CacheControl[filecache,redis] ; extra == "dev"
|
|
22
|
+
Requires-Dist: CacheControl[filecache, redis] ; extra == "dev"
|
|
23
23
|
Requires-Dist: build ; extra == "dev"
|
|
24
|
+
Requires-Dist: cherrypy ; extra == "dev"
|
|
25
|
+
Requires-Dist: codespell[tomli] ; extra == "dev"
|
|
26
|
+
Requires-Dist: furo ; extra == "dev"
|
|
24
27
|
Requires-Dist: mypy ; extra == "dev"
|
|
25
|
-
Requires-Dist: tox ; extra == "dev"
|
|
26
|
-
Requires-Dist: pytest-cov ; extra == "dev"
|
|
27
28
|
Requires-Dist: pytest ; extra == "dev"
|
|
28
|
-
Requires-Dist:
|
|
29
|
+
Requires-Dist: pytest-cov ; extra == "dev"
|
|
30
|
+
Requires-Dist: ruff ; extra == "dev"
|
|
29
31
|
Requires-Dist: sphinx ; extra == "dev"
|
|
30
|
-
Requires-Dist: furo ; extra == "dev"
|
|
31
32
|
Requires-Dist: sphinx-copybutton ; extra == "dev"
|
|
32
|
-
Requires-Dist:
|
|
33
|
+
Requires-Dist: tox ; extra == "dev"
|
|
33
34
|
Requires-Dist: types-redis ; extra == "dev"
|
|
34
35
|
Requires-Dist: types-requests ; extra == "dev"
|
|
35
36
|
Requires-Dist: filelock >= 3.8.0 ; extra == "filecache"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
cachecontrol/__init__.py,sha256=OH-C3m9lq6dFoW_QSgRwB8YSMfQ2gCMGnVrZnM58iGQ,641
|
|
2
|
+
cachecontrol/_cmd.py,sha256=4l2UbK9N85Vr_KTkF4LjvSlsr-TZnOXTfT2NODlIMtc,1672
|
|
3
|
+
cachecontrol/adapter.py,sha256=iDVHGpoxToBXlUqA5CEBsYXoDdcJl52im3hgBQFNs4A,6240
|
|
4
|
+
cachecontrol/cache.py,sha256=OXwv7Fn2AwnKNiahJHnjtvaKLndvVLv_-zO-ltlV9qI,1953
|
|
5
|
+
cachecontrol/controller.py,sha256=jauCh8kaIjGHHOIpDWJzy1sPNbmtLrvJaAMNBbmXnJg,18504
|
|
6
|
+
cachecontrol/filewrapper.py,sha256=2ktXNPE0KqnyzF24aOsKCA58HQq1xeC6l2g6_zwjghc,4291
|
|
7
|
+
cachecontrol/heuristics.py,sha256=ccecGyeEycWDY_Kfnx41ebYl7eSdDCLM5X6Sx0f5fZE,4869
|
|
8
|
+
cachecontrol/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
cachecontrol/serialize.py,sha256=dP5k_UKYUAano6TKG9qlbKHbFMonz0AV_lYR3IFCGMg,5110
|
|
10
|
+
cachecontrol/wrapper.py,sha256=KyaQ4Bq1RqsX-zA4pXH62nmcU511ECIGn5gCvmNIj20,1328
|
|
11
|
+
cachecontrol/caches/__init__.py,sha256=3-BaJBXjdt-4iFbv-799XjzRBsd6zF9wOEqOdDuAAro,279
|
|
12
|
+
cachecontrol/caches/file_cache.py,sha256=SDloWAx_x_bHKe_m9DZTtUKADlhtZD7GnMmQv35GhU8,5375
|
|
13
|
+
cachecontrol/caches/redis_cache.py,sha256=94Qw4INGwjHcCDwMnOe0gbbcP2fttrlui-e1-Yutclw,1374
|
|
14
|
+
cachecontrol-0.14.1.dist-info/entry_points.txt,sha256=1NtpBDZSbqMMbkIxhMBtvQoF7c5Mmfd7EE9hBPG_sLs,54
|
|
15
|
+
cachecontrol-0.14.1.dist-info/LICENSE.txt,sha256=hu7uh74qQ_P_H1ZJb0UfaSQ5JvAl_tuwM2ZsMExMFhs,558
|
|
16
|
+
cachecontrol-0.14.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
|
17
|
+
cachecontrol-0.14.1.dist-info/METADATA,sha256=k-riefJr5n0VFsKe6g_A62TITr2P7WtO1PIGAJJpmDA,3121
|
|
18
|
+
cachecontrol-0.14.1.dist-info/RECORD,,
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
cachecontrol/__init__.py,sha256=SMGrJRpX7KUHcXGkaeWdDgI7dI1XAXzNPOir-i6KmcQ,640
|
|
2
|
-
cachecontrol/_cmd.py,sha256=4l2UbK9N85Vr_KTkF4LjvSlsr-TZnOXTfT2NODlIMtc,1672
|
|
3
|
-
cachecontrol/adapter.py,sha256=45loQAiioWqu4LMtMwtMOkfbxAgoQb3HVnsl-pmjouA,6247
|
|
4
|
-
cachecontrol/cache.py,sha256=OTQj72tUf8C1uEgczdl3Gc8vkldSzsTITKtDGKMx4z8,1952
|
|
5
|
-
cachecontrol/controller.py,sha256=Mn_xrzRWwvfU8iWvQJbsIyvhVSm9Rwlb69FeSGce90k,18503
|
|
6
|
-
cachecontrol/filewrapper.py,sha256=STttGmIPBvZzt2b51dUOwoWX5crcMCpKZOisM3f5BNc,4292
|
|
7
|
-
cachecontrol/heuristics.py,sha256=0FgcTfzFRQ9kUQFirhY3LOIg5wBWUsCBuxx_GGr_UuQ,4822
|
|
8
|
-
cachecontrol/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
cachecontrol/serialize.py,sha256=dP5k_UKYUAano6TKG9qlbKHbFMonz0AV_lYR3IFCGMg,5110
|
|
10
|
-
cachecontrol/wrapper.py,sha256=KyaQ4Bq1RqsX-zA4pXH62nmcU511ECIGn5gCvmNIj20,1328
|
|
11
|
-
cachecontrol/caches/__init__.py,sha256=3-BaJBXjdt-4iFbv-799XjzRBsd6zF9wOEqOdDuAAro,279
|
|
12
|
-
cachecontrol/caches/file_cache.py,sha256=ylcOG9re-vjxiBi6Dm_wNP-KyK_i0NIop1OqHMAz460,5382
|
|
13
|
-
cachecontrol/caches/redis_cache.py,sha256=94Qw4INGwjHcCDwMnOe0gbbcP2fttrlui-e1-Yutclw,1374
|
|
14
|
-
cachecontrol-0.14.0.dist-info/entry_points.txt,sha256=1NtpBDZSbqMMbkIxhMBtvQoF7c5Mmfd7EE9hBPG_sLs,54
|
|
15
|
-
cachecontrol-0.14.0.dist-info/LICENSE.txt,sha256=hu7uh74qQ_P_H1ZJb0UfaSQ5JvAl_tuwM2ZsMExMFhs,558
|
|
16
|
-
cachecontrol-0.14.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
17
|
-
cachecontrol-0.14.0.dist-info/METADATA,sha256=oLjmqL8HBxsz7qNjhDDhuRMaL_kfJbw4ED70tnNPCTk,3071
|
|
18
|
-
cachecontrol-0.14.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|