Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Join theFastAPI Cloud waiting list 🚀
Follow@fastapi onX (Twitter) to stay updated
FollowFastAPI onLinkedIn to stay updated
Subscribe to theFastAPI and friends newsletter 🎉
sponsor
sponsor
sponsor
sponsor
sponsor
sponsor
sponsor
sponsor
sponsor
sponsor
sponsor

About FastAPI versions

FastAPI is already being used in production in many applications and systems. And the test coverage is kept at 100%. But its development is still moving quickly.

New features are added frequently, bugs are fixed regularly, and the code is still continuously improving.

That's why the current versions are still0.x.x, this reflects that each version could potentially have breaking changes. This follows theSemantic Versioning conventions.

You can create production applications withFastAPI right now (and you have probably been doing it for some time), you just have to make sure that you use a version that works correctly with the rest of your code.

Pin yourfastapi version

The first thing you should do is to "pin" the version ofFastAPI you are using to the specific latest version that you know works correctly for your application.

For example, let's say you are using version0.112.0 in your app.

If you use arequirements.txt file you could specify the version with:

fastapi[standard]==0.112.0

that would mean that you would use exactly the version0.112.0.

Or you could also pin it with:

fastapi[standard]>=0.112.0,<0.113.0

that would mean that you would use the versions0.112.0 or above, but less than0.113.0, for example, a version0.112.2 would still be accepted.

If you use any other tool to manage your installations, likeuv, Poetry, Pipenv, or others, they all have a way that you can use to define specific versions for your packages.

Available versions

You can see the available versions (e.g. to check what is the current latest) in theRelease Notes.

About versions

Following the Semantic Versioning conventions, any version below1.0.0 could potentially add breaking changes.

FastAPI also follows the convention that any "PATCH" version change is for bug fixes and non-breaking changes.

Tip

The "PATCH" is the last number, for example, in0.2.3, the PATCH version is3.

So, you should be able to pin to a version like:

fastapi>=0.45.0,<0.46.0

Breaking changes and new features are added in "MINOR" versions.

Tip

The "MINOR" is the number in the middle, for example, in0.2.3, the MINOR version is2.

Upgrading the FastAPI versions

You should add tests for your app.

WithFastAPI it's very easy (thanks to Starlette), check the docs:Testing

After you have tests, then you can upgrade theFastAPI version to a more recent one, and make sure that all your code is working correctly by running your tests.

If everything is working, or after you make the necessary changes, and all your tests are passing, then you can pin yourfastapi to that new recent version.

About Starlette

You shouldn't pin the version ofstarlette.

Different versions ofFastAPI will use a specific newer version of Starlette.

So, you can just letFastAPI use the correct Starlette version.

About Pydantic

Pydantic includes the tests forFastAPI with its own tests, so new versions of Pydantic (above1.0.0) are always compatible with FastAPI.

You can pin Pydantic to any version above1.0.0 that works for you.

For example:

pydantic>=2.7.0,<3.0.0

[8]ページ先頭

©2009-2026 Movatter.jp