diff --git a/cachecontrol/__init__.py b/cachecontrol/__init__.py index 82646f37..4fd76a44 100644 --- a/cachecontrol/__init__.py +++ b/cachecontrol/__init__.py @@ -6,6 +6,7 @@ Make it easy to import from cachecontrol without long namespaces. """ + __author__ = "Eric Larson" __email__ = "eric@ionrock.org" __version__ = "0.14.0" diff --git a/cachecontrol/cache.py b/cachecontrol/cache.py index 3293b005..91598e92 100644 --- a/cachecontrol/cache.py +++ b/cachecontrol/cache.py @@ -6,6 +6,7 @@ The cache object API for implementing caches. The default is a thread safe in-memory dictionary. """ + from __future__ import annotations from threading import Lock diff --git a/cachecontrol/controller.py b/cachecontrol/controller.py index 70414be3..f826aec0 100644 --- a/cachecontrol/controller.py +++ b/cachecontrol/controller.py @@ -5,6 +5,7 @@ """ The httplib2 algorithms ported for use with requests. """ + from __future__ import annotations import calendar diff --git a/cachecontrol/heuristics.py b/cachecontrol/heuristics.py index ea1badca..f64444f8 100644 --- a/cachecontrol/heuristics.py +++ b/cachecontrol/heuristics.py @@ -68,7 +68,9 @@ def update_headers(self, response: HTTPResponse) -> dict[str, str]: if "expires" not in response.headers: date = parsedate(response.headers["date"]) - expires = expire_after(timedelta(days=1), date=datetime(*date[:6], tzinfo=timezone.utc)) # type: ignore[index,misc] + expires = expire_after( + timedelta(days=1), date=datetime(*date[:6], tzinfo=timezone.utc) + ) # type: ignore[index,misc] headers["expires"] = datetime_to_header(expires) headers["cache-control"] = "public" return headers diff --git a/tests/test_cache_control.py b/tests/test_cache_control.py index 8f0b8f33..f77b4ddc 100644 --- a/tests/test_cache_control.py +++ b/tests/test_cache_control.py @@ -5,6 +5,7 @@ """ Unit tests that verify our caching methods work correctly. """ + import time from tempfile import mkdtemp from unittest.mock import ANY, Mock diff --git a/tests/test_redirects.py b/tests/test_redirects.py index a37bb2b2..9d6932b2 100644 --- a/tests/test_redirects.py +++ b/tests/test_redirects.py @@ -5,6 +5,7 @@ """ Test for supporting redirect caches as needed. """ + import requests from cachecontrol import CacheControl diff --git a/tests/test_storage_filecache.py b/tests/test_storage_filecache.py index d9dd2419..df74a3bd 100644 --- a/tests/test_storage_filecache.py +++ b/tests/test_storage_filecache.py @@ -5,6 +5,7 @@ """ Unit tests that verify FileCache storage works correctly. """ + import os import string