fix(deps): update dependency fastapi to ^0.95.0 #2217
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.92.0
->^0.95.0
Release Notes
tiangolo/fastapi
v0.95.0
Compare Source
Highlights
This release adds support for dependencies and parameters using
Annotated
and recommends its usage. ✨This has several benefits, one of the main ones is that now the parameters of your functions with
Annotated
would not be affected at all.If you call those functions in other places in your code, the actual default values will be kept, your editor will help you notice missing required arguments, Python will require you to pass required arguments at runtime, you will be able to use the same functions for different things and with different libraries (e.g. Typer will soon support
Annotated
too, then you could use the same function for an API and a CLI), etc.Because
Annotated
is standard Python, you still get all the benefits from editors and tools, like autocompletion, inline errors, etc.One of the biggest benefits is that now you can create
Annotated
dependencies that are then shared by multiple path operation functions, this will allow you to reduce a lot of code duplication in your codebase, while keeping all the support from editors and tools.For example, you could have code like this:
There's a bit of code duplication for the dependency:
...the bigger the codebase, the more noticeable it is.
Now you can create an annotated dependency once, like this:
And then you can reuse this
Annotated
dependency:...and
CurrentUser
has all the typing information asUser
, so your editor will work as expected (autocompletion and everything), and FastAPI will be able to understand the dependency defined inAnnotated
. 😎Roughly all the docs have been rewritten to use
Annotated
as the main way to declare parameters and dependencies. All the examples in the docs now include a version withAnnotated
and a version without it, for each of the specific Python versions (when there are small differences/improvements in more recent versions). There were around 23K new lines added between docs, examples, and tests. 🚀The key updated docs are:
Annotated
Annotated
Annotated
dependenciesSpecial thanks to @nzig for the core implementation and to @adriangb for the inspiration and idea with Xpresso! 🚀
Features
Annotated
for specifying dependencies and parameters. PR #4871 by @nzig.Docs
Annotated
in docs. PR #9270 by @tiangolo.Annotated
as the main recommendation, with new examples and tests. PR #9268 by @tiangolo.v0.94.1
Compare Source
Fixes
v0.94.0
Compare Source
Upgrades
lifespan
with state. PR #9239 by @tiangolo.Docs
Translations
docs/ru/docs/history-design-future.md
. PR #5986 by @Xewus.Internal
pydantic
to PyPI classifiers. PR #5914 by @yezz123.v0.93.0
Compare Source
Features
lifespan
async context managers (supersedingstartup
andshutdown
events). Initial PR #2944 by @uSpike.Now, instead of using independent
startup
andshutdown
events, you can define that logic in a single function withyield
decorated with@asynccontextmanager
(an async context manager).For example:
Note: This is the recommended way going forward, instead of using
startup
andshutdown
events.Read more about it in the new docs: Advanced User Guide: Lifespan Events.
Docs
docs/en/docs/tutorial/metadata.md
forReDoc
. PR #6005 by @eykamp.Translations
docs/fr/docs/advanced/path-operation-advanced-configuration.md
. PR #9221 by @axel584.docs/tutorial/debugging.md
. PR #9175 by @frabc.deployment/manually.md
. PR #3693 by @rjNemo.Internal
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.