Skip to content

Upgrading CacheControl 0.12 to 0.13

Breaking0.12.14 → 0.13.1Breaking1New4Fixed4Other8

BreakingUpgrade verdict

1 breaking change.

  • Remove use of utcnow.
1 item needs code or config changes

Python requirement changed in 0.13.1rc0: >=3.6 → >=3.7.

Breaking1
Remove use of utcnow.

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • added: variable __author__
  • added: variable __email__
  • added: variable __version__
  • changed: constructor CacheControlAdapter(cache=…, cache_etags=…, controller_class=…, serializer=…, heuristic=…, cacheable_methods=…, *args, **kw) → constructor CacheControlAdapter(cache: BaseCache | None=…, cache_etags: bool=…, controller_class: type[CacheController] | None=…, serializer: Serializer | None=…, heuristic: BaseHeuristic | None=…, cacheable_methods: Collection[str] | None=…, *args: Any, **kw: Any) -> None
  • changed: method CacheControlAdapter.build_response(request, response, from_cache=…, cacheable_methods=…) → method CacheControlAdapter.build_response(request: PreparedRequest, response: HTTPResponse, from_cache: bool=…, cacheable_methods: Collection[str] | None=…) -> Response
  • changed: method CacheControlAdapter.close() → method CacheControlAdapter.close() -> None
  • changed: method CacheControlAdapter.send(request, cacheable_methods=…, **kw) → method CacheControlAdapter.send(request: PreparedRequest, stream: bool=…, timeout: None | float | tuple[float, float] | tuple[float, None]=…, verify: bool | str=…, cert: None | bytes | str | tuple[bytes | str, bytes | str]=…, proxies: Mapping[str, str] | None=…, cacheable_methods: Collection[str] | None=…) -> Response
  • changed: class BaseCache(object) → class BaseCache
  • changed: constructor DictCache(init_dict=…) → constructor DictCache(init_dict: MutableMapping[str, bytes] | None=…) -> None
  • changed: method BaseCache.close() → method BaseCache.close() -> None
  • changed: method BaseCache.delete(key) → method BaseCache.delete(key: str) -> None
  • changed: method BaseCache.get(key) → method BaseCache.get(key: str) -> bytes | None
  • changed: method BaseCache.set(key, value, expires=…) → method BaseCache.set(key: str, value: bytes, expires: int | datetime | None=…) -> None
  • changed: method DictCache.delete(key) → method DictCache.delete(key: str) -> None
  • changed: method DictCache.get(key) → method DictCache.get(key: str) -> bytes | None
  • changed: method DictCache.set(key, value, expires=…) → method DictCache.set(key: str, value: bytes, expires: int | datetime | None=…) -> None
  • changed: method SeparateBodyBaseCache.get_body(key) → method SeparateBodyBaseCache.get_body(key: str) -> IO[bytes] | None
  • changed: method SeparateBodyBaseCache.set_body(key, body) → method SeparateBodyBaseCache.set_body(key: str, body: bytes) -> None
  • removed: variable FileNotFoundError
  • changed: function url_to_file_path(url, filecache) → function url_to_file_path(url: str, filecache: FileCache) -> str
  • changed: method FileCache.delete(key) → method FileCache.delete(key: str) -> None
  • changed: method SeparateBodyFileCache.delete(key) → method SeparateBodyFileCache.delete(key: str) -> None
  • changed: method SeparateBodyFileCache.get_body(key) → method SeparateBodyFileCache.get_body(key: str) -> IO[bytes] | None
  • changed: method SeparateBodyFileCache.set_body(key, body) → method SeparateBodyFileCache.set_body(key: str, body: bytes) -> None
  • changed: constructor RedisCache(conn) → constructor RedisCache(conn: Redis[bytes]) -> None
  • changed: method RedisCache.clear() → method RedisCache.clear() -> None
  • changed: method RedisCache.close() → method RedisCache.close() -> None
  • changed: method RedisCache.delete(key) → method RedisCache.delete(key: str) -> None
  • changed: method RedisCache.get(key) → method RedisCache.get(key: str) -> bytes | None
  • changed: method RedisCache.set(key, value, expires=…) → method RedisCache.set(key: str, value: bytes, expires: int | datetime | None=…) -> None
  • removed: variable text_type
  • changed: class CacheController(object) → class CacheController
  • changed: constructor CacheController(cache=…, cache_etags=…, serializer=…, status_codes=…) → constructor CacheController(cache: BaseCache | None=…, cache_etags: bool=…, serializer: Serializer | None=…, status_codes: Collection[int] | None=…)
  • changed: function parse_uri(uri) → function parse_uri(uri: str) -> tuple[str, str, str, str, str]
  • changed: method CacheController.cache_response(request, response, body=…, status_codes=…) → method CacheController.cache_response(request: PreparedRequest, response: HTTPResponse, body: bytes | None=…, status_codes: Collection[int] | None=…) -> None
  • changed: method CacheController.cached_request(request) → method CacheController.cached_request(request: PreparedRequest) -> HTTPResponse | Literal[False]
  • changed: method CacheController.conditional_headers(request) → method CacheController.conditional_headers(request: PreparedRequest) -> dict[str, str]
  • changed: method CacheController.parse_cache_control(headers) → method CacheController.parse_cache_control(headers: Mapping[str, str]) -> dict[str, int | None]
  • changed: method CacheController.update_cached_response(request, response) → method CacheController.update_cached_response(request: PreparedRequest, response: HTTPResponse) -> HTTPResponse
  • changed: static method CacheController.cache_url(uri) → static method CacheController.cache_url(uri: str) -> str
  • changed: class CallbackFileWrapper(object) → class CallbackFileWrapper
  • changed: constructor CallbackFileWrapper(fp, callback) → constructor CallbackFileWrapper(fp: HTTPResponse, callback: Callable[[bytes], None] | None) -> None
  • changed: method CallbackFileWrapper.read(amt=…) → method CallbackFileWrapper.read(amt: int | None=…) -> bytes
  • changed: class BaseHeuristic(object) → class BaseHeuristic
  • changed: constructor ExpiresAfter(**kw) → constructor ExpiresAfter(**kw: Any) -> None
  • changed: function datetime_to_header(dt) → function datetime_to_header(dt: datetime) -> str
  • changed: function expire_after(delta, date=…) → function expire_after(delta: timedelta, date: datetime | None=…) -> datetime
  • changed: method BaseHeuristic.apply(response) → method BaseHeuristic.apply(response: HTTPResponse) -> HTTPResponse
  • changed: method BaseHeuristic.update_headers(response) → method BaseHeuristic.update_headers(response: HTTPResponse) -> dict[str, str]
  • changed: method BaseHeuristic.warning(response) → method BaseHeuristic.warning(response: HTTPResponse) -> str | None
  • changed: method ExpiresAfter.update_headers(response) → method ExpiresAfter.update_headers(response: HTTPResponse) -> dict[str, str]
  • changed: method ExpiresAfter.warning(response) → method ExpiresAfter.warning(response: HTTPResponse) -> str | None
  • changed: method LastModified.update_headers(resp) → method LastModified.update_headers(resp: HTTPResponse) -> dict[str, str]
  • changed: method LastModified.warning(resp) → method LastModified.warning(resp: HTTPResponse) -> str | None
  • changed: method OneDayCache.update_headers(response) → method OneDayCache.update_headers(response: HTTPResponse) -> dict[str, str]
  • changed: class Serializer(object) → class Serializer
  • changed: method Serializer.dumps(request, response, body=…) → method Serializer.dumps(request: PreparedRequest, response: HTTPResponse, body: bytes | None=…) -> bytes
  • changed: method Serializer.loads(request, data, body_file=…) → method Serializer.loads(request: PreparedRequest, data: bytes, body_file: IO[bytes] | None=…) -> HTTPResponse | None
  • changed: method Serializer.prepare_response(request, cached, body_file=…) → method Serializer.prepare_response(request: PreparedRequest, cached: Mapping[str, Any], body_file: IO[bytes] | None=…) -> HTTPResponse | None
  • added: field Serializer.serde_version
  • added: method Serializer.serialize(data: dict[str, Any]) -> bytes
  • changed: function CacheControl(sess, cache=…, cache_etags=…, serializer=…, heuristic=…, controller_class=…, adapter_class=…, cacheable_methods=…) → function CacheControl(sess: requests.Session, cache: BaseCache | None=…, cache_etags: bool=…, serializer: Serializer | None=…, heuristic: BaseHeuristic | None=…, controller_class: type[CacheController] | None=…, adapter_class: type[CacheControlAdapter] | None=…, cacheable_methods: Collection[str] | None=…) -> requests.Session