hishel 0.0.31__tar.gz → 0.0.32__tar.gz

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.
Files changed (29) hide show
  1. {hishel-0.0.31 → hishel-0.0.32}/CHANGELOG.md +4 -0
  2. {hishel-0.0.31 → hishel-0.0.32}/PKG-INFO +5 -1
  3. {hishel-0.0.31 → hishel-0.0.32}/hishel/__init__.py +1 -1
  4. {hishel-0.0.31 → hishel-0.0.32}/hishel/_controller.py +4 -2
  5. {hishel-0.0.31 → hishel-0.0.32}/.gitignore +0 -0
  6. {hishel-0.0.31 → hishel-0.0.32}/LICENSE +0 -0
  7. {hishel-0.0.31 → hishel-0.0.32}/README.md +0 -0
  8. {hishel-0.0.31 → hishel-0.0.32}/hishel/_async/__init__.py +0 -0
  9. {hishel-0.0.31 → hishel-0.0.32}/hishel/_async/_client.py +0 -0
  10. {hishel-0.0.31 → hishel-0.0.32}/hishel/_async/_mock.py +0 -0
  11. {hishel-0.0.31 → hishel-0.0.32}/hishel/_async/_pool.py +0 -0
  12. {hishel-0.0.31 → hishel-0.0.32}/hishel/_async/_storages.py +0 -0
  13. {hishel-0.0.31 → hishel-0.0.32}/hishel/_async/_transports.py +0 -0
  14. {hishel-0.0.31 → hishel-0.0.32}/hishel/_exceptions.py +0 -0
  15. {hishel-0.0.31 → hishel-0.0.32}/hishel/_files.py +0 -0
  16. {hishel-0.0.31 → hishel-0.0.32}/hishel/_headers.py +0 -0
  17. {hishel-0.0.31 → hishel-0.0.32}/hishel/_lfu_cache.py +0 -0
  18. {hishel-0.0.31 → hishel-0.0.32}/hishel/_s3.py +0 -0
  19. {hishel-0.0.31 → hishel-0.0.32}/hishel/_serializers.py +0 -0
  20. {hishel-0.0.31 → hishel-0.0.32}/hishel/_sync/__init__.py +0 -0
  21. {hishel-0.0.31 → hishel-0.0.32}/hishel/_sync/_client.py +0 -0
  22. {hishel-0.0.31 → hishel-0.0.32}/hishel/_sync/_mock.py +0 -0
  23. {hishel-0.0.31 → hishel-0.0.32}/hishel/_sync/_pool.py +0 -0
  24. {hishel-0.0.31 → hishel-0.0.32}/hishel/_sync/_storages.py +0 -0
  25. {hishel-0.0.31 → hishel-0.0.32}/hishel/_sync/_transports.py +0 -0
  26. {hishel-0.0.31 → hishel-0.0.32}/hishel/_synchronization.py +0 -0
  27. {hishel-0.0.31 → hishel-0.0.32}/hishel/_utils.py +0 -0
  28. {hishel-0.0.31 → hishel-0.0.32}/hishel/py.typed +0 -0
  29. {hishel-0.0.31 → hishel-0.0.32}/pyproject.toml +0 -0
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.32 (27th Sep, 2024)
4
+
5
+ - Don't raise an exception if the `Date` header is not present. (#273)
6
+
3
7
  ## 0.0.31 (22nd Sep, 2024)
4
8
 
5
9
  - Ignore file not found error when cleaning up a file storage. (#264)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hishel
3
- Version: 0.0.31
3
+ Version: 0.0.32
4
4
  Summary: Persistent cache implementation for httpx and httpcore
5
5
  Project-URL: Homepage, https://hishel.com
6
6
  Project-URL: Source, https://github.com/karpetrosyan/hishel
@@ -175,6 +175,10 @@ Help us grow and continue developing good software for you ❤️
175
175
 
176
176
  # Changelog
177
177
 
178
+ ## 0.0.32 (27th Sep, 2024)
179
+
180
+ - Don't raise an exception if the `Date` header is not present. (#273)
181
+
178
182
  ## 0.0.31 (22nd Sep, 2024)
179
183
 
180
184
  - Ignore file not found error when cleaning up a file storage. (#264)
@@ -14,4 +14,4 @@ def install_cache() -> None: # pragma: no cover
14
14
  httpx.Client = CacheClient # type: ignore
15
15
 
16
16
 
17
- __version__ = "0.0.31"
17
+ __version__ = "0.0.32"
@@ -79,8 +79,10 @@ def get_heuristic_freshness(response: Response, clock: "BaseClock") -> int:
79
79
 
80
80
 
81
81
  def get_age(response: Response, clock: "BaseClock") -> int:
82
- if not header_presents(response.headers, b"date"): # pragma: no cover
83
- raise RuntimeError("The `Date` header is missing in the response.")
82
+ if not header_presents(response.headers, b"date"):
83
+ # If the response does not have a date header, then it is impossible to calculate the age.
84
+ # Instead of raising an exception, we return infinity to be sure that the response is not considered fresh.
85
+ return float("inf") # type: ignore
84
86
 
85
87
  date = parse_date(extract_header_values_decoded(response.headers, b"date")[0])
86
88
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes