[PR #77] [MERGED] Update dependency fastapi to ^0.95.0 #74

Closed
opened 2026-09-02 13:12:32 +02:00 by TheLovinator · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/TheLovinator1/twitter-image-collage-maker/pull/77
Author: @renovate[bot]
Created: 3/18/2023
Status: Merged
Merged: 3/18/2023
Merged by: @renovate[bot]

Base: masterHead: renovate/fastapi-0.x


📝 Commits (1)

  • 3490d56 Update dependency fastapi to ^0.95.0

📊 Changes

2 files changed (+5 additions, -5 deletions)

View changed files

📝 poetry.lock (+4 -4)
📝 pyproject.toml (+1 -1)

📄 Description

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
fastapi ^0.94.0 -> ^0.95.0 age adoption passing confidence

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:

def get_current_user(token: str):

### authenticate user
    return User()

@​app.get("/items/")
def read_items(user: User = Depends(get_current_user)):
    ...

@​app.post("/items/")
def create_item(*, user: User = Depends(get_current_user), item: Item):
    ...

@​app.get("/items/{item_id}")
def read_item(*, user: User = Depends(get_current_user), item_id: int):
    ...

@​app.delete("/items/{item_id}")
def delete_item(*, user: User = Depends(get_current_user), item_id: int):
    ...

There's a bit of code duplication for the dependency:

user: User = Depends(get_current_user)

...the bigger the codebase, the more noticeable it is.

Now you can create an annotated dependency once, like this:

CurrentUser = Annotated[User, Depends(get_current_user)]

And then you can reuse this Annotated dependency:

CurrentUser = Annotated[User, Depends(get_current_user)]

@​app.get("/items/")
def read_items(user: CurrentUser):
    ...

@​app.post("/items/")
def create_item(user: CurrentUser, item: Item):
    ...

@​app.get("/items/{item_id}")
def read_item(user: CurrentUser, item_id: int):
    ...

@​app.delete("/items/{item_id}")
def delete_item(user: CurrentUser, item_id: int):
    ...

...and CurrentUser has all the typing information as User, so your editor will work as expected (autocompletion and everything), and FastAPI will be able to understand the dependency defined in Annotated. 😎

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 with Annotated 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:

Special thanks to @​nzig for the core implementation and to @​adriangb for the inspiration and idea with Xpresso! 🚀

Features
  • Add support for PEP-593 Annotated for specifying dependencies and parameters. PR #​4871 by @​nzig.
Docs
  • 📝 Tweak tip recommending Annotated in docs. PR #​9270 by @​tiangolo.
  • 📝 Update order of examples, latest Python version first, and simplify version tab names. PR #​9269 by @​tiangolo.
  • 📝 Update all docs to use Annotated as the main recommendation, with new examples and tests. PR #​9268 by @​tiangolo.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TheLovinator1/twitter-image-collage-maker/pull/77 **Author:** [@renovate[bot]](https://github.com/apps/renovate) **Created:** 3/18/2023 **Status:** ✅ Merged **Merged:** 3/18/2023 **Merged by:** [@renovate[bot]](https://github.com/apps/renovate) **Base:** `master` ← **Head:** `renovate/fastapi-0.x` --- ### 📝 Commits (1) - [`3490d56`](https://github.com/TheLovinator1/twitter-image-collage-maker/commit/3490d56dbe6fa9e3d6eb0e245bf3b84a0192b2aa) Update dependency fastapi to ^0.95.0 ### 📊 Changes **2 files changed** (+5 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `poetry.lock` (+4 -4) 📝 `pyproject.toml` (+1 -1) </details> ### 📄 Description [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastapi](https://togithub.com/tiangolo/fastapi) | `^0.94.0` -> `^0.95.0` | [![age](https://badges.renovateapi.com/packages/pypi/fastapi/0.95.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/fastapi/0.95.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/fastapi/0.95.0/compatibility-slim/0.94.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/fastapi/0.95.0/confidence-slim/0.94.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>tiangolo/fastapi</summary> ### [`v0.95.0`](https://togithub.com/tiangolo/fastapi/releases/tag/0.95.0) [Compare Source](https://togithub.com/tiangolo/fastapi/compare/0.94.1...0.95.0) ##### 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: ```Python def get_current_user(token: str): ### authenticate user return User() @&#8203;app.get("/items/") def read_items(user: User = Depends(get_current_user)): ... @&#8203;app.post("/items/") def create_item(*, user: User = Depends(get_current_user), item: Item): ... @&#8203;app.get("/items/{item_id}") def read_item(*, user: User = Depends(get_current_user), item_id: int): ... @&#8203;app.delete("/items/{item_id}") def delete_item(*, user: User = Depends(get_current_user), item_id: int): ... ``` There's a bit of code duplication for the dependency: ```Python user: User = Depends(get_current_user) ``` ...the bigger the codebase, the more noticeable it is. Now you can create an annotated dependency once, like this: ```Python CurrentUser = Annotated[User, Depends(get_current_user)] ``` And then you can reuse this `Annotated` dependency: ```Python CurrentUser = Annotated[User, Depends(get_current_user)] @&#8203;app.get("/items/") def read_items(user: CurrentUser): ... @&#8203;app.post("/items/") def create_item(user: CurrentUser, item: Item): ... @&#8203;app.get("/items/{item_id}") def read_item(user: CurrentUser, item_id: int): ... @&#8203;app.delete("/items/{item_id}") def delete_item(user: CurrentUser, item_id: int): ... ``` ...and `CurrentUser` has all the typing information as `User`, so your editor will work as expected (autocompletion and everything), and **FastAPI** will be able to understand the dependency defined in `Annotated`. 😎 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 with `Annotated` 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: - Python Types Intro: - [Type Hints with Metadata Annotations](https://fastapi.tiangolo.com/python-types/#type-hints-with-metadata-annotations). - Tutorial: - [Query Parameters and String Validations - Additional validation](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#additional-validation) - [Advantages of `Annotated`](https://fastapi.tiangolo.com/tutorial/query-params-str-validations/#advantages-of-annotated) - [Path Parameters and Numeric Validations - Order the parameters as you need, tricks](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#order-the-parameters-as-you-need-tricks) - [Better with `Annotated`](https://fastapi.tiangolo.com/tutorial/path-params-numeric-validations/#better-with-annotated) - [Dependencies - First Steps - Share `Annotated` dependencies](https://fastapi.tiangolo.com/tutorial/dependencies/#share-annotated-dependencies) Special thanks to [@&#8203;nzig](https://togithub.com/nzig) for the core implementation and to [@&#8203;adriangb](https://togithub.com/adriangb) for the inspiration and idea with [Xpresso](https://togithub.com/adriangb/xpresso)! 🚀 ##### Features - ✨Add support for PEP-593 `Annotated` for specifying dependencies and parameters. PR [#&#8203;4871](https://togithub.com/tiangolo/fastapi/pull/4871) by [@&#8203;nzig](https://togithub.com/nzig). ##### Docs - 📝 Tweak tip recommending `Annotated` in docs. PR [#&#8203;9270](https://togithub.com/tiangolo/fastapi/pull/9270) by [@&#8203;tiangolo](https://togithub.com/tiangolo). - 📝 Update order of examples, latest Python version first, and simplify version tab names. PR [#&#8203;9269](https://togithub.com/tiangolo/fastapi/pull/9269) by [@&#8203;tiangolo](https://togithub.com/tiangolo). - 📝 Update all docs to use `Annotated` as the main recommendation, with new examples and tests. PR [#&#8203;9268](https://togithub.com/tiangolo/fastapi/pull/9268) by [@&#8203;tiangolo](https://togithub.com/tiangolo). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/TheLovinator1/twitter-image-collage-maker). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzUuMTEuMCJ9--> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
TheLovinator 2026-09-02 13:12:32 +02:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TheLovinator/twitter-image-collage-maker#74
No description provided.