Compare commits

...
3 Commits
Author SHA1 Message Date
Sebastián Ramírezandgithub-actions[bot] 7ac0f1b541 🔖 Release version 0.140.4 (#16070)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-07-27 15:45:50 +00:00
github-actions[bot] 44e4eeaa78 📝 Update release notes
[skip ci]
2026-07-27 15:36:07 +00:00
Sebastián Ramírez 7134121a71 ️ Skip unused dependency repeat bookkeeping (#16069) 2026-07-27 15:35:29 +00:00
3 changed files with 30 additions and 19 deletions

No files matched your search

+6
View File
@@ -7,6 +7,12 @@ hide:
## Latest Changes
## 0.140.4 (2026-07-27)
### Refactors
* ⚡️ Skip unused dependency repeat bookkeeping. PR [#16069](https://github.com/fastapi/fastapi/pull/16069) by [@tiangolo](https://github.com/tiangolo).
## 0.140.3 (2026-07-27)
### Refactors
+1 -1
View File
@@ -1,6 +1,6 @@
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
__version__ = "0.140.3"
__version__ = "0.140.4"
from starlette import status as status
+23 -18
View File
@@ -152,16 +152,20 @@ def get_flat_dependant(
parent_oauth_scopes: list[str] | None = None,
_uses_scopes_cache: _UsesScopesCache | None = None,
) -> Dependant:
if visited is None:
visited = []
if _uses_scopes_cache is None:
_uses_scopes_cache = {}
visited.append(
_get_cache_key(
dependant=dependant,
uses_scopes_cache=_uses_scopes_cache,
)
track_visited = (
skip_repeats or visited is not None or _uses_scopes_cache is not None
)
if track_visited:
if visited is None:
visited = []
if _uses_scopes_cache is None:
_uses_scopes_cache = {}
visited.append(
_get_cache_key(
dependant=dependant,
uses_scopes_cache=_uses_scopes_cache,
)
)
use_parent_oauth_scopes = (parent_oauth_scopes or []) + (
_get_oauth_scopes(dependant=dependant)
)
@@ -187,15 +191,16 @@ def get_flat_dependant(
scope=dependant.scope,
)
for sub_dependant in dependant.dependencies:
if (
skip_repeats
and _get_cache_key(
dependant=sub_dependant,
uses_scopes_cache=_uses_scopes_cache,
)
in visited
):
continue
if skip_repeats:
assert visited is not None
if (
_get_cache_key(
dependant=sub_dependant,
uses_scopes_cache=_uses_scopes_cache,
)
in visited
):
continue
flat_sub = get_flat_dependant(
sub_dependant,
skip_repeats=skip_repeats,