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

⬆️(deps): update dependency fastapi to ^0.101.0 #669

Closed
wants to merge 2 commits into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 18, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
fastapi ^0.99.0 -> ^0.101.0 age adoption passing confidence

Release Notes

tiangolo/fastapi (fastapi)

v0.101.1

Compare Source

Fixes
  • ✨ Add ResponseValidationError printable details, to show up in server error logs. PR #​10078 by @​tiangolo.
Refactors
Docs
Translations
Internal

v0.101.0

Compare Source

Features
  • ✨ Enable Pydantic's serialization mode for responses, add support for Pydantic's computed_field, better OpenAPI for response models, proper required attributes, better generated clients. PR #​10011 by @​tiangolo.
Refactors
Upgrades
Translations
Internal

v0.100.1

Compare Source

Fixes
  • 🐛 Replace MultHostUrl to AnyUrl for compatibility with older versions of Pydantic v1. PR #​9852 by @​Kludex.
Docs
  • 📝 Update links for self-hosted Swagger UI, point to v5, for OpenAPI 31.0. PR #​9834 by @​tiangolo.
Translations
Internal

v0.100.0

Compare Source

✨ Support for Pydantic v2

Pydantic version 2 has the core re-written in Rust and includes a lot of improvements and features, for example:

  • Improved correctness in corner cases.
  • Safer types.
  • Better performance and less energy consumption.
  • Better extensibility.
  • etc.

...all this while keeping the same Python API. In most of the cases, for simple models, you can simply upgrade the Pydantic version and get all the benefits. 🚀

In some cases, for pure data validation and processing, you can get performance improvements of 20x or more. This means 2,000% or more. 🤯

When you use FastAPI, there's a lot more going on, processing the request and response, handling dependencies, executing your own code, and particularly, waiting for the network. But you will probably still get some nice performance improvements just from the upgrade.

The focus of this release is compatibility with Pydantic v1 and v2, to make sure your current apps keep working. Later there will be more focus on refactors, correctness, code improvements, and then performance improvements. Some third-party early beta testers that ran benchmarks on the beta releases of FastAPI reported improvements of 2x - 3x. Which is not bad for just doing pip install --upgrade fastapi pydantic. This was not an official benchmark and I didn't check it myself, but it's a good sign.

Migration

Check out the Pydantic migration guide.

For the things that need changes in your Pydantic models, the Pydantic team built bump-pydantic.

A command line tool that will process your code and update most of the things automatically for you. Make sure you have your code in git first, and review each of the changes to make sure everything is correct before committing the changes.

Pydantic v1

This version of FastAPI still supports Pydantic v1. And although Pydantic v1 will be deprecated at some point, ti will still be supported for a while.

This means that you can install the new Pydantic v2, and if something fails, you can install Pydantic v1 while you fix any problems you might have, but having the latest FastAPI.

There are tests for both Pydantic v1 and v2, and test coverage is kept at 100%.

Changes
  • There are new parameter fields supported by Pydantic Field() for:

    • Path()
    • Query()
    • Header()
    • Cookie()
    • Body()
    • Form()
    • File()
  • The new parameter fields are:

    • default_factory
    • alias_priority
    • validation_alias
    • serialization_alias
    • discriminator
    • strict
    • multiple_of
    • allow_inf_nan
    • max_digits
    • decimal_places
    • json_schema_extra

...you can read about them in the Pydantic docs.

  • The parameter regex has been deprecated and replaced by pattern.

  • New Pydantic models use an improved and simplified attribute model_config that takes a simple dict instead of an internal class Config for their configuration.

  • The attribute schema_extra for the internal class Config has been replaced by the key json_schema_extra in the new model_config dict.

  • When you install "fastapi[all]" it now also includes:

  • Now Pydantic Settings is an additional optional package (included in "fastapi[all]"). To use settings you should now import from pydantic_settings import BaseSettings instead of importing from pydantic directly.

  • PR #​9816 by @​tiangolo, included all the work done (in multiple PRs) on the beta branch (main-pv2).


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.


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

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

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Aug 18, 2023
@renovate
Copy link
Contributor Author

renovate bot commented Aug 18, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Merging #669 (2e1a4e8) into main (70a8b96) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

❗ Current head 2e1a4e8 differs from pull request most recent head b1da68a. Consider uploading reports for the commit b1da68a to get more accurate results

@@           Coverage Diff           @@
##             main     #669   +/-   ##
=======================================
  Coverage   93.52%   93.52%           
=======================================
  Files           9        9           
  Lines         340      340           
=======================================
  Hits          318      318           
  Misses         22       22           

@mraniki mraniki closed this Aug 18, 2023
@renovate
Copy link
Contributor Author

renovate bot commented Aug 18, 2023

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (^0.101.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.

@renovate renovate bot deleted the renovate/fastapi-0.x branch August 18, 2023 12:33
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant