Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency fastapi to >=0.115.6, <0.116.0 #245

Closed
wants to merge 1 commit into from

Conversation

red-hat-konflux[bot]
Copy link

@red-hat-konflux red-hat-konflux bot commented Nov 23, 2024

This PR contains the following updates:

Package Update Change
fastapi (changelog) minor >= 0.107.0, < 0.113.0 -> >=0.115.6, <0.116.0

Release Notes

fastapi/fastapi (fastapi)

v0.115.6

Compare Source

Fixes
  • 🐛 Preserve traceback when an exception is raised in sync dependency with yield. PR #​5823 by @​sombek.
Refactors
  • ♻️ Update tests and internals for compatibility with Pydantic >=2.10. PR #​12971 by @​tamird.
Docs
Translations
  • 🌐 Add Traditional Chinese translation for docs/zh-hant/docs/async.md. PR #​12990 by @​ILoveSorasakiHina.
  • 🌐 Add Traditional Chinese translation for docs/zh-hant/docs/tutorial/query-param-models.md. PR #​12932 by @​Vincy1230.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/testing-dependencies.md. PR #​12992 by @​Limsunoh.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/websockets.md. PR #​12991 by @​kwang1215.
  • 🌐 Add Portuguese translation for docs/pt/docs/tutorial/response-model.md. PR #​12933 by @​AndreBBM.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/middlewares.md. PR #​12753 by @​nahyunkeem.
  • 🌐 Add Korean translation for docs/ko/docs/advanced/openapi-webhooks.md. PR #​12752 by @​saeye.
  • 🌐 Add Chinese translation for docs/zh/docs/tutorial/query-param-models.md. PR #​12931 by @​Vincy1230.
  • 🌐 Add Russian translation for docs/ru/docs/tutorial/query-param-models.md. PR #​12445 by @​gitgernit.
  • 🌐 Add Korean translation for docs/ko/docs/tutorial/query-param-models.md. PR #​12940 by @​jts8257.
  • 🔥 Remove obsolete tutorial translation to Chinese for docs/zh/docs/tutorial/sql-databases.md, it references files that are no longer on the repo. PR #​12949 by @​tiangolo.
Internal

v0.115.5

Compare Source

Refactors
Docs
Translations
Internal

v0.115.4

Compare Source

Refactors
  • ♻️ Update logic to import and check python-multipart for compatibility with newer version. PR #​12627 by @​tiangolo.
Docs
Translations
Internal

v0.115.3

Compare Source

Upgrades
Docs
Translations
Internal

v0.115.2

Compare Source

Upgrades

v0.115.1

Compare Source

Fixes
Refactors
Docs
Translations
Internal

v0.115.0

Compare Source

Highlights

Now you can declare Query, Header, and Cookie parameters with Pydantic models. 🎉

Query Parameter Models

Use Pydantic models for Query parameters:

from typing import Annotated, Literal

from fastapi import FastAPI, Query
from pydantic import BaseModel, Field

app = FastAPI()

class FilterParams(BaseModel):
    limit: int = Field(100, gt=0, le=100)
    offset: int = Field(0, ge=0)
    order_by: Literal["created_at", "updated_at"] = "created_at"
    tags: list[str] = []

@&#8203;app.get("/items/")
async def read_items(filter_query: Annotated[FilterParams, Query()]):
    return filter_query

Read the new docs: Query Parameter Models.

Header Parameter Models

Use Pydantic models for Header parameters:

from typing import Annotated

from fastapi import FastAPI, Header
from pydantic import BaseModel

app = FastAPI()

class CommonHeaders(BaseModel):
    host: str
    save_data: bool
    if_modified_since: str | None = None
    traceparent: str | None = None
    x_tag: list[str] = []

@&#8203;app.get("/items/")
async def read_items(headers: Annotated[CommonHeaders, Header()]):
    return headers

Read the new docs: Header Parameter Models.

Cookie Parameter Models

Use Pydantic models for Cookie parameters:

from typing import Annotated

from fastapi import Cookie, FastAPI
from pydantic import BaseModel

app = FastAPI()

class Cookies(BaseModel):
    session_id: str
    fatebook_tracker: str | None = None
    googall_tracker: str | None = None

@&#8203;app.get("/items/")
async def read_items(cookies: Annotated[Cookies, Cookie()]):
    return cookies

Read the new docs: Cookie Parameter Models.

Forbid Extra Query (Cookie, Header) Parameters

Use Pydantic models to restrict extra values for Query parameters (also applies to Header and Cookie parameters).

To achieve it, use Pydantic's model_config = {"extra": "forbid"}:

from typing import Annotated, Literal

from fastapi import FastAPI, Query
from pydantic import BaseModel, Field

app = FastAPI()

class FilterParams(BaseModel):
    model_config = {"extra": "forbid"}

    limit: int = Field(100, gt=0, le=100)
    offset: int = Field(0, ge=0)
    order_by: Literal["created_at", "updated_at"] = "created_at"
    tags: list[str] = []

@&#8203;app.get("/items/")
async def read_items(filter_query: Annotated[FilterParams, Query()]):
    return filter_query

This applies to Query, Header, and Cookie parameters, read the new docs:

Features
  • ✨ Add support for Pydantic models for parameters using Query, Cookie, Header. PR #​12199 by @​tiangolo.
Translations
  • 🌐 Add Portuguese translation for docs/pt/docs/advanced/security/http-basic-auth.md. PR #​12195 by @​ceb10n.
Internal

v0.114.2

Compare Source

Fixes
Translations
  • 🌐 Add Portuguese translation for

Configuration

📅 Schedule: Branch creation - "after 5am on saturday" (UTC), 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.


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

This PR has been generated by Renovate Bot.

Copy link

openshift-ci bot commented Nov 23, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: red-hat-konflux[bot]
Once this PR has been reviewed and has the lgtm label, please assign raghul-m for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

openshift-ci bot commented Nov 23, 2024

Hi @red-hat-konflux[bot]. Thanks for your PR.

I'm waiting for a opendatahub-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
@red-hat-konflux red-hat-konflux bot force-pushed the konflux/mintmaker/main/fastapi-0.x branch from 2c1c087 to 01b2d7d Compare December 7, 2024 08:07
@red-hat-konflux red-hat-konflux bot changed the title chore(deps): update dependency fastapi to >=0.115.5, <0.116.0 chore(deps): update dependency fastapi to >=0.115.6, <0.116.0 Dec 7, 2024
@dtrifiro dtrifiro closed this Dec 10, 2024
Copy link
Author

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (>=0.115.6, <0.116.0). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@red-hat-konflux red-hat-konflux bot deleted the konflux/mintmaker/main/fastapi-0.x branch December 10, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant