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

⬆ Update fastapi requirement from <0.95.0,>=0.65.2 to >=0.65.2,<0.96.0 #86

Merged
merged 1 commit into from
Mar 25, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 20, 2023

Updates the requirements on fastapi to permit the latest version.

Release notes

Sourced from fastapi's releases.

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:

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:

... (truncated)

Commits
  • d666ccb 🔖 Release version 0.95.0
  • 38f0cad 📝 Tweak release notes
  • bd90bed 📝 Update release notes
  • 546392d 📝 Update release notes
  • 0bc87ec 📝 Tweak tip recommending Annotated in docs (#9270)
  • fbfd535 📝 Update release notes
  • 994ea1a 📝 Update release notes
  • 6967354 📝 Update order of examples, latest Python version first, and simplify version...
  • 166d348 📝 Update release notes
  • 9eaed2e 📝 Update all docs to use Annotated as the main recommendation, with new exa...
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [fastapi](https://github.com/tiangolo/fastapi) to permit the latest version.
- [Release notes](https://github.com/tiangolo/fastapi/releases)
- [Commits](tiangolo/fastapi@0.65.2...0.95.0)

---
updated-dependencies:
- dependency-name: fastapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Mar 20, 2023
@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (5482c41) 92.21% compared to head (33017be) 92.21%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage   92.21%   92.21%           
=======================================
  Files          11       11           
  Lines         257      257           
=======================================
  Hits          237      237           
  Misses         20       20           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yezz123 yezz123 merged commit f454140 into main Mar 25, 2023
@yezz123 yezz123 deleted the dependabot/pip/fastapi-gte-0.65.2-and-lt-0.96.0 branch March 25, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant