From 6ad04f7a89759ce2491201851b11791af90ab9d6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 28 Apr 2024 09:15:01 +0200 Subject: [PATCH] make format --- cachecontrol/__init__.py | 1 + cachecontrol/cache.py | 1 + cachecontrol/controller.py | 1 + cachecontrol/heuristics.py | 4 +++- tests/test_cache_control.py | 1 + tests/test_redirects.py | 1 + tests/test_storage_filecache.py | 1 + 7 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cachecontrol/__init__.py b/cachecontrol/__init__.py index 82646f3..4fd76a4 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 3293b00..91598e9 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 70414be..f826aec 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 ea1badc..f64444f 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 8f0b8f3..f77b4dd 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 a37bb2b..9d6932b 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 d9dd241..df74a3b 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