CacheControl 0.14.2__py3-none-any.whl → 0.14.4__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 CHANGED
@@ -7,14 +7,16 @@
7
7
  Make it easy to import from cachecontrol without long namespaces.
8
8
  """
9
9
 
10
- __author__ = "Eric Larson"
11
- __email__ = "eric@ionrock.org"
12
- __version__ = "0.14.2"
10
+ import importlib.metadata
13
11
 
14
12
  from cachecontrol.adapter import CacheControlAdapter
15
13
  from cachecontrol.controller import CacheController
16
14
  from cachecontrol.wrapper import CacheControl
17
15
 
16
+ __author__ = "Eric Larson"
17
+ __email__ = "eric@ionrock.org"
18
+ __version__ = importlib.metadata.version("cachecontrol")
19
+
18
20
  __all__ = [
19
21
  "__author__",
20
22
  "__email__",
cachecontrol/adapter.py CHANGED
@@ -4,7 +4,6 @@
4
4
  from __future__ import annotations
5
5
 
6
6
  import functools
7
- import types
8
7
  import weakref
9
8
  import zlib
10
9
  from typing import TYPE_CHECKING, Any, Collection, Mapping
@@ -490,7 +490,7 @@ class CacheController:
490
490
  #
491
491
  # The server isn't supposed to send headers that would make
492
492
  # the cached body invalid. But... just in case, we'll be sure
493
- # to strip out ones we know that might be problmatic due to
493
+ # to strip out ones we know that might be problematic due to
494
494
  # typical assumptions.
495
495
  excluded_headers = ["content-length"]
496
496
 
@@ -8,6 +8,7 @@ from tempfile import NamedTemporaryFile
8
8
  from typing import TYPE_CHECKING, Any, Callable
9
9
 
10
10
  if TYPE_CHECKING:
11
+ from collections.abc import Buffer
11
12
  from http.client import HTTPResponse
12
13
 
13
14
 
@@ -31,7 +32,7 @@ class CallbackFileWrapper:
31
32
  """
32
33
 
33
34
  def __init__(
34
- self, fp: HTTPResponse, callback: Callable[[bytes], None] | None
35
+ self, fp: HTTPResponse, callback: Callable[[Buffer], None] | None
35
36
  ) -> None:
36
37
  self.__buf = NamedTemporaryFile("rb+", delete=True)
37
38
  self.__fp = fp
@@ -68,6 +69,7 @@ class CallbackFileWrapper:
68
69
  return False
69
70
 
70
71
  def _close(self) -> None:
72
+ result: Buffer
71
73
  if self.__callback:
72
74
  if self.__buf.tell() == 0:
73
75
  # Empty file:
@@ -1,46 +1,46 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: CacheControl
3
- Version: 0.14.2
3
+ Version: 0.14.4
4
4
  Summary: httplib2 caching for requests
5
5
  Keywords: requests,http,caching,web
6
+ Author: Eric Larson, Frost Ming, William Woodruff
6
7
  Author-email: Eric Larson <ericlarson@ionrock.com>, Frost Ming <me@frostming.com>, William Woodruff <william@yossarian.net>
7
- Requires-Python: >=3.8
8
- Description-Content-Type: text/x-rst
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE.txt
9
10
  Classifier: Development Status :: 4 - Beta
10
11
  Classifier: Environment :: Web Environment
11
- Classifier: License :: OSI Approved :: Apache Software License
12
12
  Classifier: Operating System :: OS Independent
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
13
  Classifier: Programming Language :: Python :: 3.10
16
14
  Classifier: Programming Language :: Python :: 3.11
17
15
  Classifier: Programming Language :: Python :: 3.12
18
16
  Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
19
18
  Classifier: Topic :: Internet :: WWW/HTTP
20
- Requires-Dist: requests >= 2.16.0
21
- Requires-Dist: msgpack >= 0.5.2, < 2.0.0
22
- Requires-Dist: CacheControl[filecache, redis] ; extra == "dev"
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"
27
- Requires-Dist: mypy ; extra == "dev"
28
- Requires-Dist: pytest ; extra == "dev"
29
- Requires-Dist: pytest-cov ; extra == "dev"
30
- Requires-Dist: ruff ; extra == "dev"
31
- Requires-Dist: sphinx ; extra == "dev"
32
- Requires-Dist: sphinx-copybutton ; extra == "dev"
33
- Requires-Dist: tox ; extra == "dev"
34
- Requires-Dist: types-redis ; extra == "dev"
35
- Requires-Dist: types-requests ; extra == "dev"
36
- Requires-Dist: filelock >= 3.8.0 ; extra == "filecache"
37
- Requires-Dist: redis>=2.10.5 ; extra == "redis"
19
+ Requires-Dist: requests>=2.16.0
20
+ Requires-Dist: msgpack>=0.5.2,<2.0.0
21
+ Requires-Dist: cachecontrol[filecache,redis] ; extra == 'dev'
22
+ Requires-Dist: cherrypy ; extra == 'dev'
23
+ Requires-Dist: cheroot>=11.1.2 ; extra == 'dev'
24
+ Requires-Dist: codespell ; extra == 'dev'
25
+ Requires-Dist: furo ; extra == 'dev'
26
+ Requires-Dist: mypy ; extra == 'dev'
27
+ Requires-Dist: pytest ; extra == 'dev'
28
+ Requires-Dist: pytest-cov ; extra == 'dev'
29
+ Requires-Dist: ruff ; extra == 'dev'
30
+ Requires-Dist: sphinx ; extra == 'dev'
31
+ Requires-Dist: sphinx-copybutton ; extra == 'dev'
32
+ Requires-Dist: types-redis ; extra == 'dev'
33
+ Requires-Dist: types-requests ; extra == 'dev'
34
+ Requires-Dist: filelock>=3.8.0 ; extra == 'filecache'
35
+ Requires-Dist: redis>=2.10.5 ; extra == 'redis'
36
+ Requires-Python: >=3.10
38
37
  Project-URL: Homepage, https://pypi.org/project/CacheControl/
39
38
  Project-URL: Issues, https://github.com/psf/cachecontrol/issues
40
39
  Project-URL: Source, https://github.com/psf/cachecontrol
41
40
  Provides-Extra: dev
42
41
  Provides-Extra: filecache
43
42
  Provides-Extra: redis
43
+ Description-Content-Type: text/x-rst
44
44
 
45
45
  ..
46
46
  SPDX-FileCopyrightText: SPDX-FileCopyrightText: 2015 Eric Larson
@@ -89,4 +89,3 @@ For more info, check out the docs_
89
89
  .. _docs: http://cachecontrol.readthedocs.org/en/latest/
90
90
  .. _httplib2: https://github.com/httplib2/httplib2
91
91
  .. _requests: http://docs.python-requests.org/
92
-
@@ -0,0 +1,18 @@
1
+ cachecontrol/__init__.py,sha256=aMPfN_9huuMwdL8qh269agzp2ugriVc2okgB4PGHcS0,702
2
+ cachecontrol/_cmd.py,sha256=4l2UbK9N85Vr_KTkF4LjvSlsr-TZnOXTfT2NODlIMtc,1672
3
+ cachecontrol/adapter.py,sha256=VBORpVV3mQCLgGa5Mk531KtjoaYTZs4HBd222GfdL4o,6478
4
+ cachecontrol/cache.py,sha256=OXwv7Fn2AwnKNiahJHnjtvaKLndvVLv_-zO-ltlV9qI,1953
5
+ cachecontrol/caches/__init__.py,sha256=3-BaJBXjdt-4iFbv-799XjzRBsd6zF9wOEqOdDuAAro,279
6
+ cachecontrol/caches/file_cache.py,sha256=0Df9CcKBaGjKF4dhkFGncLx-YHae0BOPd0jo67mG1rQ,4093
7
+ cachecontrol/caches/redis_cache.py,sha256=94Qw4INGwjHcCDwMnOe0gbbcP2fttrlui-e1-Yutclw,1374
8
+ cachecontrol/controller.py,sha256=qZF9BOy_aDElMAXPejH5ohixTgkxYkXWPoB0Ocer_Vk,19030
9
+ cachecontrol/filewrapper.py,sha256=DhxC_rSk-beKdbsYhfvBUDovQHX9r3gHH_jP9-q_mKk,4354
10
+ cachecontrol/heuristics.py,sha256=ccecGyeEycWDY_Kfnx41ebYl7eSdDCLM5X6Sx0f5fZE,4869
11
+ cachecontrol/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ cachecontrol/serialize.py,sha256=dP5k_UKYUAano6TKG9qlbKHbFMonz0AV_lYR3IFCGMg,5110
13
+ cachecontrol/wrapper.py,sha256=KyaQ4Bq1RqsX-zA4pXH62nmcU511ECIGn5gCvmNIj20,1328
14
+ cachecontrol-0.14.4.dist-info/licenses/LICENSE.txt,sha256=hu7uh74qQ_P_H1ZJb0UfaSQ5JvAl_tuwM2ZsMExMFhs,558
15
+ cachecontrol-0.14.4.dist-info/WHEEL,sha256=w4ZtLaDgMAZW2MMZZwtH8zENekoQYBCeullI-zsXJQk,78
16
+ cachecontrol-0.14.4.dist-info/entry_points.txt,sha256=HjCekaRCv8kfNqP5WehMR29IWxIA5VrhoOeKrCykCLc,56
17
+ cachecontrol-0.14.4.dist-info/METADATA,sha256=o7eXpgH_41Bc5LDGNTY8zyaplZ8kkOkC-EGktZlrXMQ,3074
18
+ cachecontrol-0.14.4.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.10.1
2
+ Generator: uv 0.9.9
3
3
  Root-Is-Purelib: true
4
- Tag: py3-none-any
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ doesitcache = cachecontrol._cmd:main
3
+
@@ -1,18 +0,0 @@
1
- cachecontrol/__init__.py,sha256=GW28Jizgz3q_vQN7OpVRVYVDBy-t_nNKN7cJP0jPR2E,641
2
- cachecontrol/_cmd.py,sha256=4l2UbK9N85Vr_KTkF4LjvSlsr-TZnOXTfT2NODlIMtc,1672
3
- cachecontrol/adapter.py,sha256=6WA-glAfcEfzWiMbM5XZFVnCilEGOWFwIzYaMXCENx8,6491
4
- cachecontrol/cache.py,sha256=OXwv7Fn2AwnKNiahJHnjtvaKLndvVLv_-zO-ltlV9qI,1953
5
- cachecontrol/controller.py,sha256=sBPfFSG1GY1gQ_-pPIFLrnShodU0D2h7KmPZv_l9cn4,19029
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=0Df9CcKBaGjKF4dhkFGncLx-YHae0BOPd0jo67mG1rQ,4093
13
- cachecontrol/caches/redis_cache.py,sha256=94Qw4INGwjHcCDwMnOe0gbbcP2fttrlui-e1-Yutclw,1374
14
- cachecontrol-0.14.2.dist-info/entry_points.txt,sha256=1NtpBDZSbqMMbkIxhMBtvQoF7c5Mmfd7EE9hBPG_sLs,54
15
- cachecontrol-0.14.2.dist-info/LICENSE.txt,sha256=hu7uh74qQ_P_H1ZJb0UfaSQ5JvAl_tuwM2ZsMExMFhs,558
16
- cachecontrol-0.14.2.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
17
- cachecontrol-0.14.2.dist-info/METADATA,sha256=dMsEu-cLt5UCDVb-HQEmJkmZ1srnjRNM3OIHptu5Yvg,3121
18
- cachecontrol-0.14.2.dist-info/RECORD,,
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- doesitcache=cachecontrol._cmd:main
3
-