hishel 1.1.1__tar.gz → 1.1.3__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 (27) hide show
  1. hishel-1.1.3/CHANGELOG.md +217 -0
  2. {hishel-1.1.1 → hishel-1.1.3}/PKG-INFO +164 -72
  3. {hishel-1.1.1 → hishel-1.1.3}/hishel/__init__.py +2 -1
  4. {hishel-1.1.1 → hishel-1.1.3}/hishel/_async_httpx.py +3 -0
  5. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/_spec.py +5 -4
  6. {hishel-1.1.1 → hishel-1.1.3}/hishel/_sync_httpx.py +3 -0
  7. {hishel-1.1.1 → hishel-1.1.3}/pyproject.toml +1 -1
  8. hishel-1.1.1/CHANGELOG.md +0 -125
  9. {hishel-1.1.1 → hishel-1.1.3}/.gitignore +0 -0
  10. {hishel-1.1.1 → hishel-1.1.3}/LICENSE +0 -0
  11. {hishel-1.1.1 → hishel-1.1.3}/README.md +0 -0
  12. {hishel-1.1.1 → hishel-1.1.3}/hishel/_async_cache.py +0 -0
  13. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/_headers.py +0 -0
  14. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/_storages/_async_base.py +0 -0
  15. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/_storages/_async_sqlite.py +0 -0
  16. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/_storages/_packing.py +0 -0
  17. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/_storages/_sync_base.py +0 -0
  18. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/_storages/_sync_sqlite.py +0 -0
  19. {hishel-1.1.1 → hishel-1.1.3}/hishel/_core/models.py +0 -0
  20. {hishel-1.1.1 → hishel-1.1.3}/hishel/_policies.py +0 -0
  21. {hishel-1.1.1 → hishel-1.1.3}/hishel/_sync_cache.py +0 -0
  22. {hishel-1.1.1 → hishel-1.1.3}/hishel/_utils.py +0 -0
  23. {hishel-1.1.1 → hishel-1.1.3}/hishel/asgi.py +0 -0
  24. {hishel-1.1.1 → hishel-1.1.3}/hishel/fastapi.py +0 -0
  25. {hishel-1.1.1 → hishel-1.1.3}/hishel/httpx.py +0 -0
  26. {hishel-1.1.1 → hishel-1.1.3}/hishel/py.typed +0 -0
  27. {hishel-1.1.1 → hishel-1.1.3}/hishel/requests.py +0 -0
@@ -0,0 +1,217 @@
1
+ ## What's Changed in 1.1.3
2
+ ### ⚙️ Miscellaneous Tasks
3
+
4
+ * improve git-cliff docs by @karpetrosyan
5
+ ### 🐛 Bug Fixes
6
+
7
+ * fix: add BaseFilter to __all__ exports by @martinblech in [#408](https://github.com/karpetrosyan/hishel/pull/408)
8
+ * fix: set `after_revalidation=True` for `NeedsToBeUpdated` -> `FromCache` transition by @jlopex in [#402](https://github.com/karpetrosyan/hishel/pull/402)
9
+
10
+ ### Contributors
11
+ * @martinblech
12
+ * @jlopex
13
+ * @karpetrosyan
14
+
15
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.1.2...1.1.3
16
+
17
+ ## What's Changed in 1.1.2
18
+ ### 🐛 Bug Fixes
19
+
20
+ * respect shared option when excluding unstorable headers by @karpetrosyan
21
+ * remove s-maxage consideration for private caches by @karpetrosyan
22
+ * ensure 304 responses don't leak by @karpetrosyan
23
+
24
+ ### Contributors
25
+ * @karpetrosyan
26
+ * @jlopex
27
+
28
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.1.1...1.1.2
29
+
30
+ ## What's Changed in 1.1.1
31
+ ### ⚙️ Miscellaneous Tasks
32
+
33
+ * chore(deps-dev): bump the python-packages group with 10 updates by @dependabot[bot] in [#396](https://github.com/karpetrosyan/hishel/pull/396)
34
+ ### 📦 Dependencies
35
+
36
+ * chore(deps): bump astral-sh/setup-uv from 5 to 7 by @dependabot[bot] in [#393](https://github.com/karpetrosyan/hishel/pull/393)
37
+ * chore(deps): bump actions/download-artifact from 4 to 6 by @dependabot[bot] in [#394](https://github.com/karpetrosyan/hishel/pull/394)
38
+ * chore(deps): bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in [#395](https://github.com/karpetrosyan/hishel/pull/395)
39
+
40
+ ### Contributors
41
+ * @karpetrosyan
42
+ * @dependabot[bot]
43
+
44
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.1.0...1.1.1
45
+
46
+ ## What's Changed in 1.1.0
47
+ ### ⚙️ Miscellaneous Tasks
48
+
49
+ * add in memory example by @karpetrosyan
50
+ ### 🐛 Bug Fixes
51
+
52
+ * pass any response with non-expected status code on revalidation to client by @karpetrosyan
53
+ * pass any response with non-expected status code on revalidation to client by @karpetrosyan
54
+ ### 🚀 Features
55
+
56
+ * allow setting storage base with via `database_path` for sqlite storage by @karpetrosyan
57
+
58
+ ### Contributors
59
+ * @karpetrosyan
60
+
61
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0...1.1.0
62
+
63
+ ## What's Changed in 1.0.0
64
+ ### ⚙️ Miscellaneous Tasks
65
+
66
+ * add examples, improve docs by @karpetrosyan
67
+
68
+ ### Contributors
69
+ * @karpetrosyan
70
+
71
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0b1...1.0.0
72
+
73
+ ## What's Changed in 1.0.0b1
74
+ ### ♻️ Refactoring
75
+
76
+ * add policies by @karpetrosyan
77
+ ### ⚙️ Miscellaneous Tasks
78
+
79
+ * add graphql docs by @karpetrosyan
80
+ * improve sans-io diagram colors by @karpetrosyan
81
+ ### 🐛 Bug Fixes
82
+
83
+ * filter out `Transfer-Encoding` header for asgi responses by @karpetrosyan
84
+ * body-sensitive responses caching by @karpetrosyan
85
+ ### 🚀 Features
86
+
87
+ * add global `use_body_key` setting by @karpetrosyan
88
+
89
+ ### Contributors
90
+ * @karpetrosyan
91
+
92
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev3...1.0.0b1
93
+
94
+ ## What's Changed in 1.0.0.dev3
95
+ ### ♻️ Refactoring
96
+
97
+ * automatically generate httpx sync integration from async by @karpetrosyan
98
+ * replace pairs with entries, simplify storage API by @karpetrosyan
99
+ ### ⚙️ Miscellaneous Tasks
100
+
101
+ * more robust compressed response caching by @karpetrosyan
102
+ * add custom integrations docs by @karpetrosyan
103
+ * simplify metadata docs by @karpetrosyan
104
+ ### 🐛 Bug Fixes
105
+
106
+ * add date header for proper age calculation by @karpetrosyan
107
+ * handle httpx iterable usage instead of iterator correctly by @karpetrosyan
108
+ * fix compressed data caching for requests by @karpetrosyan
109
+ * raise on consumed httpx streams, which we can't store as is (it's already decoded) by @karpetrosyan
110
+ * add missing permissions into `publish.yml` by @karpetrosyan
111
+ ### 🚀 Features
112
+
113
+ * add logging for asgi by @karpetrosyan
114
+ * add blacksheep integration examples by @karpetrosyan
115
+ * add integrations with fastapi and asgi by @karpetrosyan
116
+
117
+ ### Contributors
118
+ * @karpetrosyan
119
+
120
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev2...1.0.0.dev3
121
+
122
+ ## What's Changed in 1.0.0.dev2
123
+ ### ⚙️ Miscellaneous Tasks
124
+
125
+ * fix time travel date, explicitly specify the timezone by @karpetrosyan
126
+ * add import without extras check in ci by @karpetrosyan
127
+ * remove redundant utils and tests by @karpetrosyan
128
+ ### 🐛 Bug Fixes
129
+
130
+ * don't raise an error on 3xx during revalidation by @karpetrosyan
131
+ * fix check for storing auth requests by @karpetrosyan
132
+ ### 🚀 Features
133
+
134
+ * add hishel_created_at response metadata by @karpetrosyan
135
+
136
+ ### Contributors
137
+ * @karpetrosyan
138
+
139
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev1...1.0.0.dev2
140
+
141
+ ## What's Changed in 1.0.0.dev1
142
+ ### ⚙️ Miscellaneous Tasks
143
+
144
+ * remove some redundant utils methods by @karpetrosyan
145
+ ### 📦 Dependencies
146
+
147
+ * improve git-cliff by @karpetrosyan
148
+ * install async extra with httpx by @karpetrosyan
149
+ * make `anysqlite` optional dependency by @karpetrosyan
150
+ * make httpx and async libs optional dependencies by @karpetrosyan
151
+
152
+ ### Contributors
153
+ * @karpetrosyan
154
+
155
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev0...1.0.0.dev1
156
+
157
+ ## What's Changed in 1.0.0.dev0
158
+ ### ⚙️ Miscellaneous Tasks
159
+
160
+ * improve docs versioning, deploy dev doc on ci by @karpetrosyan
161
+ * use mike powered versioning by @karpetrosyan
162
+
163
+ ### Contributors
164
+ * @karpetrosyan
165
+
166
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/0.1.5...1.0.0.dev0
167
+
168
+ ## What's Changed in 0.1.5
169
+ ### ⚙️ Miscellaneous Tasks
170
+
171
+ * remove some redundant files from repo by @karpetrosyan
172
+ ### 🐛 Bug Fixes
173
+
174
+ * fix some line breaks by @karpetrosyan
175
+ ### 🚀 Features
176
+
177
+ * increase requests buffer size to 128KB, disable charset detection by @karpetrosyan
178
+ * feat: add close method to storages API by @karpetrosyan in [#384](https://github.com/karpetrosyan/hishel/pull/384)
179
+ * better cache-control parsing by @karpetrosyan
180
+ * set chunk size to 128KB for httpx to reduce SQLite read/writes by @karpetrosyan
181
+
182
+ ### Contributors
183
+ * @karpetrosyan
184
+
185
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/0.1.4...0.1.5
186
+
187
+ ## What's Changed in 0.1.4
188
+ ### ⚙️ Miscellaneous Tasks
189
+
190
+ * move some tests to beta by @karpetrosyan
191
+ * add sqlite tests for new storage by @karpetrosyan
192
+ * temporary remove python3.14 from CI by @karpetrosyan
193
+ * chore(internal): remove src folder by @karpetrosyan in [#373](https://github.com/karpetrosyan/hishel/pull/373)
194
+ * chore: improve CI by @karpetrosyan in [#369](https://github.com/karpetrosyan/hishel/pull/369)
195
+ ### 🐛 Bug Fixes
196
+
197
+ * fix beta imports by @karpetrosyan
198
+ * create an sqlite file in a cache folder by @karpetrosyan
199
+ ### 🚀 Features
200
+
201
+ * better async implemetation for sqlite storage by @karpetrosyan
202
+ * get rid of some locks from sqlite storage by @karpetrosyan
203
+ * add sqlite storage for beta storages by @karpetrosyan
204
+ * feat: allow already consumed streams with `CacheTransport` by @jamesbraza in [#377](https://github.com/karpetrosyan/hishel/pull/377)
205
+ * feat: add support for a sans-IO API by @karpetrosyan in [#366](https://github.com/karpetrosyan/hishel/pull/366)
206
+
207
+ ### Contributors
208
+ * @karpetrosyan
209
+ * @jamesbraza
210
+ * @GugNersesyan
211
+ * @dependabot[bot]
212
+ * @mmdbalkhi
213
+ * @AstraLuma
214
+ * @deathaxe
215
+
216
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/0.1.3...0.1.4
217
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hishel
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: Elegant HTTP Caching for Python
5
5
  Project-URL: Homepage, https://hishel.com
6
6
  Project-URL: Source, https://github.com/karpetrosyan/hishel
@@ -406,128 +406,220 @@ Hishel is inspired by and builds upon the excellent work in the Python HTTP ecos
406
406
  <strong>Made with ❤️ by <a href="https://github.com/karpetrosyan">Kar Petrosyan</a></strong>
407
407
  </p>
408
408
 
409
- # Changelog
409
+ ## What's Changed in 1.1.3
410
+ ### ⚙️ Miscellaneous Tasks
411
+
412
+ * improve git-cliff docs by @karpetrosyan
413
+ ### 🐛 Bug Fixes
414
+
415
+ * fix: add BaseFilter to __all__ exports by @martinblech in [#408](https://github.com/karpetrosyan/hishel/pull/408)
416
+ * fix: set `after_revalidation=True` for `NeedsToBeUpdated` -> `FromCache` transition by @jlopex in [#402](https://github.com/karpetrosyan/hishel/pull/402)
417
+
418
+ ### Contributors
419
+ * @martinblech
420
+ * @jlopex
421
+ * @karpetrosyan
422
+
423
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.1.2...1.1.3
424
+
425
+ ## What's Changed in 1.1.2
426
+ ### 🐛 Bug Fixes
427
+
428
+ * respect shared option when excluding unstorable headers by @karpetrosyan
429
+ * remove s-maxage consideration for private caches by @karpetrosyan
430
+ * ensure 304 responses don't leak by @karpetrosyan
431
+
432
+ ### Contributors
433
+ * @karpetrosyan
434
+ * @jlopex
410
435
 
411
- All notable changes to this project will be documented in this file.
436
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.1.1...1.1.2
412
437
 
413
- ## 1.1.1 - 2025-11-01
438
+ ## What's Changed in 1.1.1
414
439
  ### ⚙️ Miscellaneous Tasks
415
- - Bump the python-packages group with 10 updates (#396)
416
440
 
441
+ * chore(deps-dev): bump the python-packages group with 10 updates by @dependabot[bot] in [#396](https://github.com/karpetrosyan/hishel/pull/396)
417
442
  ### 📦 Dependencies
418
- - Bump actions/upload-artifact from 4 to 5 (#395)
419
- - Bump actions/download-artifact from 4 to 6 (#394)
420
- - Bump astral-sh/setup-uv from 5 to 7 (#393)
421
443
 
422
- ## 1.1.0 - 2025-10-31
444
+ * chore(deps): bump astral-sh/setup-uv from 5 to 7 by @dependabot[bot] in [#393](https://github.com/karpetrosyan/hishel/pull/393)
445
+ * chore(deps): bump actions/download-artifact from 4 to 6 by @dependabot[bot] in [#394](https://github.com/karpetrosyan/hishel/pull/394)
446
+ * chore(deps): bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in [#395](https://github.com/karpetrosyan/hishel/pull/395)
447
+
448
+ ### Contributors
449
+ * @karpetrosyan
450
+ * @dependabot[bot]
451
+
452
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.1.0...1.1.1
453
+
454
+ ## What's Changed in 1.1.0
423
455
  ### ⚙️ Miscellaneous Tasks
424
- - Add in memory example
425
456
 
457
+ * add in memory example by @karpetrosyan
426
458
  ### 🐛 Bug Fixes
427
- - Pass any response with non-expected status code on revalidation to client
428
- - Pass any response with non-expected status code on revalidation to client
429
459
 
460
+ * pass any response with non-expected status code on revalidation to client by @karpetrosyan
461
+ * pass any response with non-expected status code on revalidation to client by @karpetrosyan
430
462
  ### 🚀 Features
431
- - Allow setting storage base with via `database_path` for sqlite storage
432
463
 
433
- ## 1.0.0 - 2025-10-28
464
+ * allow setting storage base with via `database_path` for sqlite storage by @karpetrosyan
465
+
466
+ ### Contributors
467
+ * @karpetrosyan
468
+
469
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0...1.1.0
470
+
471
+ ## What's Changed in 1.0.0
434
472
  ### ⚙️ Miscellaneous Tasks
435
- - Add examples, improve docs
436
473
 
437
- ## 1.0.0b1 - 2025-10-28
474
+ * add examples, improve docs by @karpetrosyan
475
+
476
+ ### Contributors
477
+ * @karpetrosyan
478
+
479
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0b1...1.0.0
480
+
481
+ ## What's Changed in 1.0.0b1
438
482
  ### ♻️ Refactoring
439
- - Add policies
440
483
 
484
+ * add policies by @karpetrosyan
441
485
  ### ⚙️ Miscellaneous Tasks
442
- - Improve sans-io diagram colors
443
- - Add graphql docs
444
486
 
487
+ * add graphql docs by @karpetrosyan
488
+ * improve sans-io diagram colors by @karpetrosyan
445
489
  ### 🐛 Bug Fixes
446
- - Body-sensitive responses caching
447
- - Filter out `Transfer-Encoding` header for asgi responses
448
490
 
491
+ * filter out `Transfer-Encoding` header for asgi responses by @karpetrosyan
492
+ * body-sensitive responses caching by @karpetrosyan
449
493
  ### 🚀 Features
450
- - Add global `use_body_key` setting
451
494
 
452
- ## 1.0.0.dev3 - 2025-10-26
495
+ * add global `use_body_key` setting by @karpetrosyan
496
+
497
+ ### Contributors
498
+ * @karpetrosyan
499
+
500
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev3...1.0.0b1
501
+
502
+ ## What's Changed in 1.0.0.dev3
453
503
  ### ♻️ Refactoring
454
- - Replace pairs with entries, simplify storage API
455
- - Automatically generate httpx sync integration from async
456
504
 
505
+ * automatically generate httpx sync integration from async by @karpetrosyan
506
+ * replace pairs with entries, simplify storage API by @karpetrosyan
457
507
  ### ⚙️ Miscellaneous Tasks
458
- - Simplify metadata docs
459
- - Add custom integrations docs
460
- - More robust compressed response caching
461
508
 
509
+ * more robust compressed response caching by @karpetrosyan
510
+ * add custom integrations docs by @karpetrosyan
511
+ * simplify metadata docs by @karpetrosyan
462
512
  ### 🐛 Bug Fixes
463
- - Add missing permissions into `publish.yml`
464
- - Raise on consumed httpx streams, which we can't store as is (it's already decoded)
465
- - Fix compressed data caching for requests
466
- - Handle httpx iterable usage instead of iterator correctly
467
- - Add date header for proper age calculation
468
513
 
514
+ * add date header for proper age calculation by @karpetrosyan
515
+ * handle httpx iterable usage instead of iterator correctly by @karpetrosyan
516
+ * fix compressed data caching for requests by @karpetrosyan
517
+ * raise on consumed httpx streams, which we can't store as is (it's already decoded) by @karpetrosyan
518
+ * add missing permissions into `publish.yml` by @karpetrosyan
469
519
  ### 🚀 Features
470
- - Add integrations with fastapi and asgi
471
- - Add blacksheep integration examples
472
- - Add logging for asgi
473
520
 
474
- ## 1.0.0.dev2 - 2025-10-21
521
+ * add logging for asgi by @karpetrosyan
522
+ * add blacksheep integration examples by @karpetrosyan
523
+ * add integrations with fastapi and asgi by @karpetrosyan
524
+
525
+ ### Contributors
526
+ * @karpetrosyan
527
+
528
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev2...1.0.0.dev3
529
+
530
+ ## What's Changed in 1.0.0.dev2
475
531
  ### ⚙️ Miscellaneous Tasks
476
- - Remove redundant utils and tests
477
- - Add import without extras check in ci
478
- - Fix time travel date, explicitly specify the timezone
479
532
 
533
+ * fix time travel date, explicitly specify the timezone by @karpetrosyan
534
+ * add import without extras check in ci by @karpetrosyan
535
+ * remove redundant utils and tests by @karpetrosyan
480
536
  ### 🐛 Bug Fixes
481
- - Fix check for storing auth requests
482
- - Don't raise an error on 3xx during revalidation
483
537
 
538
+ * don't raise an error on 3xx during revalidation by @karpetrosyan
539
+ * fix check for storing auth requests by @karpetrosyan
484
540
  ### 🚀 Features
485
- - Add hishel_created_at response metadata
486
541
 
487
- ## 1.0.0.dev1 - 2025-10-21
542
+ * add hishel_created_at response metadata by @karpetrosyan
543
+
544
+ ### Contributors
545
+ * @karpetrosyan
546
+
547
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev1...1.0.0.dev2
548
+
549
+ ## What's Changed in 1.0.0.dev1
488
550
  ### ⚙️ Miscellaneous Tasks
489
- - Remove some redundant utils methods
490
551
 
552
+ * remove some redundant utils methods by @karpetrosyan
491
553
  ### 📦 Dependencies
492
- - Make httpx and async libs optional dependencies
493
- - Make `anysqlite` optional dependency
494
- - Install async extra with httpx
495
- - Improve git-cliff
496
554
 
497
- ## 1.0.0.dev0 - 2025-10-19
555
+ * improve git-cliff by @karpetrosyan
556
+ * install async extra with httpx by @karpetrosyan
557
+ * make `anysqlite` optional dependency by @karpetrosyan
558
+ * make httpx and async libs optional dependencies by @karpetrosyan
559
+
560
+ ### Contributors
561
+ * @karpetrosyan
562
+
563
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/1.0.0.dev0...1.0.0.dev1
564
+
565
+ ## What's Changed in 1.0.0.dev0
498
566
  ### ⚙️ Miscellaneous Tasks
499
- - Use mike powered versioning
500
- - Improve docs versioning, deploy dev doc on ci
501
567
 
502
- ## 0.1.5 - 2025-10-18
568
+ * improve docs versioning, deploy dev doc on ci by @karpetrosyan
569
+ * use mike powered versioning by @karpetrosyan
570
+
571
+ ### Contributors
572
+ * @karpetrosyan
573
+
574
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/0.1.5...1.0.0.dev0
575
+
576
+ ## What's Changed in 0.1.5
503
577
  ### ⚙️ Miscellaneous Tasks
504
- - Remove some redundant files from repo
505
578
 
579
+ * remove some redundant files from repo by @karpetrosyan
506
580
  ### 🐛 Bug Fixes
507
- - Fix some line breaks
508
581
 
582
+ * fix some line breaks by @karpetrosyan
509
583
  ### 🚀 Features
510
- - Set chunk size to 128KB for httpx to reduce SQLite read/writes
511
- - Better cache-control parsing
512
- - Add close method to storages API (#384)
513
- - Increase requests buffer size to 128KB, disable charset detection
514
584
 
515
- ## 0.1.4 - 2025-10-14
585
+ * increase requests buffer size to 128KB, disable charset detection by @karpetrosyan
586
+ * feat: add close method to storages API by @karpetrosyan in [#384](https://github.com/karpetrosyan/hishel/pull/384)
587
+ * better cache-control parsing by @karpetrosyan
588
+ * set chunk size to 128KB for httpx to reduce SQLite read/writes by @karpetrosyan
589
+
590
+ ### Contributors
591
+ * @karpetrosyan
592
+
593
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/0.1.4...0.1.5
594
+
595
+ ## What's Changed in 0.1.4
516
596
  ### ⚙️ Miscellaneous Tasks
517
- - Improve CI (#369)
518
- - Remove src folder (#373)
519
- - Temporary remove python3.14 from CI
520
- - Add sqlite tests for new storage
521
- - Move some tests to beta
522
597
 
598
+ * move some tests to beta by @karpetrosyan
599
+ * add sqlite tests for new storage by @karpetrosyan
600
+ * temporary remove python3.14 from CI by @karpetrosyan
601
+ * chore(internal): remove src folder by @karpetrosyan in [#373](https://github.com/karpetrosyan/hishel/pull/373)
602
+ * chore: improve CI by @karpetrosyan in [#369](https://github.com/karpetrosyan/hishel/pull/369)
523
603
  ### 🐛 Bug Fixes
524
- - Create an sqlite file in a cache folder
525
- - Fix beta imports
526
604
 
605
+ * fix beta imports by @karpetrosyan
606
+ * create an sqlite file in a cache folder by @karpetrosyan
527
607
  ### 🚀 Features
528
- - Add support for a sans-IO API (#366)
529
- - Allow already consumed streams with `CacheTransport` (#377)
530
- - Add sqlite storage for beta storages
531
- - Get rid of some locks from sqlite storage
532
- - Better async implemetation for sqlite storage
608
+
609
+ * better async implemetation for sqlite storage by @karpetrosyan
610
+ * get rid of some locks from sqlite storage by @karpetrosyan
611
+ * add sqlite storage for beta storages by @karpetrosyan
612
+ * feat: allow already consumed streams with `CacheTransport` by @jamesbraza in [#377](https://github.com/karpetrosyan/hishel/pull/377)
613
+ * feat: add support for a sans-IO API by @karpetrosyan in [#366](https://github.com/karpetrosyan/hishel/pull/366)
614
+
615
+ ### Contributors
616
+ * @karpetrosyan
617
+ * @jamesbraza
618
+ * @GugNersesyan
619
+ * @dependabot[bot]
620
+ * @mmdbalkhi
621
+ * @AstraLuma
622
+ * @deathaxe
623
+
624
+ **Full Changelog**: https://github.com/karpetrosyan/hishel/compare/0.1.3...0.1.4
533
625
 
@@ -27,7 +27,7 @@ from hishel._core.models import (
27
27
  from hishel._async_cache import AsyncCacheProxy as AsyncCacheProxy
28
28
  from hishel._sync_cache import SyncCacheProxy as SyncCacheProxy
29
29
 
30
- from hishel._policies import SpecificationPolicy, FilterPolicy, CachePolicy
30
+ from hishel._policies import SpecificationPolicy, FilterPolicy, CachePolicy, BaseFilter
31
31
 
32
32
  __all__ = (
33
33
  # New API
@@ -62,6 +62,7 @@ __all__ = (
62
62
  "AsyncCacheProxy",
63
63
  "SyncCacheProxy",
64
64
  # Policies
65
+ "BaseFilter",
65
66
  "CachePolicy",
66
67
  "SpecificationPolicy",
67
68
  "FilterPolicy",
@@ -174,6 +174,9 @@ class AsyncCacheTransport(httpx.AsyncBaseTransport):
174
174
  async def request_sender(self, request: Request) -> Response:
175
175
  httpx_request = _internal_to_httpx(request)
176
176
  httpx_response = await self.next_transport.handle_async_request(httpx_request)
177
+ if httpx_response.status_code == 304:
178
+ # 304 should not have a body, but we read it to ensure we'll not let the stream unconsumed
179
+ await httpx_response.aread()
177
180
  return _httpx_to_internal(httpx_response)
178
181
 
179
182
 
@@ -996,6 +996,7 @@ def exclude_unstorable_headers(response: Response, is_cache_shared: bool) -> Res
996
996
  def refresh_response_headers(
997
997
  stored_response: Response,
998
998
  revalidation_response: Response,
999
+ is_cache_shared: bool,
999
1000
  ) -> Response:
1000
1001
  """
1001
1002
  Updates a stored response's headers with fresh metadata from a 304 response.
@@ -1108,7 +1109,7 @@ def refresh_response_headers(
1108
1109
  stored_response,
1109
1110
  headers=Headers(new_headers),
1110
1111
  ),
1111
- is_cache_shared=True, # Assume shared cache for maximum safety
1112
+ is_cache_shared,
1112
1113
  )
1113
1114
 
1114
1115
 
@@ -1337,7 +1338,7 @@ class IdleClient(State):
1337
1338
  "A cache MUST NOT generate a stale response unless it is disconnected or
1338
1339
  doing so is explicitly permitted by the client or origin server."
1339
1340
  """
1340
- freshness_lifetime = get_freshness_lifetime(pair.response, is_cache_shared=True)
1341
+ freshness_lifetime = get_freshness_lifetime(pair.response, self.options.shared)
1341
1342
  age = get_age(pair.response)
1342
1343
 
1343
1344
  # Check freshness: response_is_fresh = (freshness_lifetime > current_age)
@@ -2245,7 +2246,7 @@ class NeedRevalidation(State):
2245
2246
  updating_entries=[
2246
2247
  replace(
2247
2248
  pair,
2248
- response=refresh_response_headers(pair.response, revalidation_response),
2249
+ response=refresh_response_headers(pair.response, revalidation_response, self.options.shared),
2249
2250
  )
2250
2251
  for pair in identified_for_revalidation
2251
2252
  ],
@@ -2409,4 +2410,4 @@ class NeedToBeUpdated(State):
2409
2410
  original_request: Request
2410
2411
 
2411
2412
  def next(self) -> FromCache:
2412
- return FromCache(entry=self.updating_entries[-1], options=self.options)
2413
+ return FromCache(entry=self.updating_entries[-1], options=self.options, after_revalidation=True)
@@ -174,6 +174,9 @@ class SyncCacheTransport(httpx.BaseTransport):
174
174
  def request_sender(self, request: Request) -> Response:
175
175
  httpx_request = _internal_to_httpx(request)
176
176
  httpx_response = self.next_transport.handle_request(httpx_request)
177
+ if httpx_response.status_code == 304:
178
+ # 304 should not have a body, but we read it to ensure we'll not let the stream unconsumed
179
+ httpx_response.read()
177
180
  return _httpx_to_internal(httpx_response)
178
181
 
179
182
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hishel"
7
- version = "1.1.1"
7
+ version = "1.1.3"
8
8
  dynamic = ["readme"]
9
9
  description = " Elegant HTTP Caching for Python"
10
10
  license = "BSD-3-Clause"
hishel-1.1.1/CHANGELOG.md DELETED
@@ -1,125 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## 1.1.1 - 2025-11-01
6
- ### ⚙️ Miscellaneous Tasks
7
- - Bump the python-packages group with 10 updates (#396)
8
-
9
- ### 📦 Dependencies
10
- - Bump actions/upload-artifact from 4 to 5 (#395)
11
- - Bump actions/download-artifact from 4 to 6 (#394)
12
- - Bump astral-sh/setup-uv from 5 to 7 (#393)
13
-
14
- ## 1.1.0 - 2025-10-31
15
- ### ⚙️ Miscellaneous Tasks
16
- - Add in memory example
17
-
18
- ### 🐛 Bug Fixes
19
- - Pass any response with non-expected status code on revalidation to client
20
- - Pass any response with non-expected status code on revalidation to client
21
-
22
- ### 🚀 Features
23
- - Allow setting storage base with via `database_path` for sqlite storage
24
-
25
- ## 1.0.0 - 2025-10-28
26
- ### ⚙️ Miscellaneous Tasks
27
- - Add examples, improve docs
28
-
29
- ## 1.0.0b1 - 2025-10-28
30
- ### ♻️ Refactoring
31
- - Add policies
32
-
33
- ### ⚙️ Miscellaneous Tasks
34
- - Improve sans-io diagram colors
35
- - Add graphql docs
36
-
37
- ### 🐛 Bug Fixes
38
- - Body-sensitive responses caching
39
- - Filter out `Transfer-Encoding` header for asgi responses
40
-
41
- ### 🚀 Features
42
- - Add global `use_body_key` setting
43
-
44
- ## 1.0.0.dev3 - 2025-10-26
45
- ### ♻️ Refactoring
46
- - Replace pairs with entries, simplify storage API
47
- - Automatically generate httpx sync integration from async
48
-
49
- ### ⚙️ Miscellaneous Tasks
50
- - Simplify metadata docs
51
- - Add custom integrations docs
52
- - More robust compressed response caching
53
-
54
- ### 🐛 Bug Fixes
55
- - Add missing permissions into `publish.yml`
56
- - Raise on consumed httpx streams, which we can't store as is (it's already decoded)
57
- - Fix compressed data caching for requests
58
- - Handle httpx iterable usage instead of iterator correctly
59
- - Add date header for proper age calculation
60
-
61
- ### 🚀 Features
62
- - Add integrations with fastapi and asgi
63
- - Add blacksheep integration examples
64
- - Add logging for asgi
65
-
66
- ## 1.0.0.dev2 - 2025-10-21
67
- ### ⚙️ Miscellaneous Tasks
68
- - Remove redundant utils and tests
69
- - Add import without extras check in ci
70
- - Fix time travel date, explicitly specify the timezone
71
-
72
- ### 🐛 Bug Fixes
73
- - Fix check for storing auth requests
74
- - Don't raise an error on 3xx during revalidation
75
-
76
- ### 🚀 Features
77
- - Add hishel_created_at response metadata
78
-
79
- ## 1.0.0.dev1 - 2025-10-21
80
- ### ⚙️ Miscellaneous Tasks
81
- - Remove some redundant utils methods
82
-
83
- ### 📦 Dependencies
84
- - Make httpx and async libs optional dependencies
85
- - Make `anysqlite` optional dependency
86
- - Install async extra with httpx
87
- - Improve git-cliff
88
-
89
- ## 1.0.0.dev0 - 2025-10-19
90
- ### ⚙️ Miscellaneous Tasks
91
- - Use mike powered versioning
92
- - Improve docs versioning, deploy dev doc on ci
93
-
94
- ## 0.1.5 - 2025-10-18
95
- ### ⚙️ Miscellaneous Tasks
96
- - Remove some redundant files from repo
97
-
98
- ### 🐛 Bug Fixes
99
- - Fix some line breaks
100
-
101
- ### 🚀 Features
102
- - Set chunk size to 128KB for httpx to reduce SQLite read/writes
103
- - Better cache-control parsing
104
- - Add close method to storages API (#384)
105
- - Increase requests buffer size to 128KB, disable charset detection
106
-
107
- ## 0.1.4 - 2025-10-14
108
- ### ⚙️ Miscellaneous Tasks
109
- - Improve CI (#369)
110
- - Remove src folder (#373)
111
- - Temporary remove python3.14 from CI
112
- - Add sqlite tests for new storage
113
- - Move some tests to beta
114
-
115
- ### 🐛 Bug Fixes
116
- - Create an sqlite file in a cache folder
117
- - Fix beta imports
118
-
119
- ### 🚀 Features
120
- - Add support for a sans-IO API (#366)
121
- - Allow already consumed streams with `CacheTransport` (#377)
122
- - Add sqlite storage for beta storages
123
- - Get rid of some locks from sqlite storage
124
- - Better async implemetation for sqlite storage
125
-
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