fastapi/fastapi
Development workflow
Branching
There is one long-lived branch: master. PRs target master directly. The repo uses the standard "fork + feature branch + PR" model — there are no release branches.
Local cycle
# 1. Sync the env after pulling
uv sync --all-extras --group dev
# 2. Edit code under fastapi/, tests/, docs_src/
# 3. Lint + format
bash scripts/format.sh # auto-fix
bash scripts/lint.sh # verify
# 4. Run only what you changed
bash scripts/test.sh tests/test_security_oauth2.py -k authorization_code
# 5. Run the full suite before pushing
bash scripts/test.shscripts/test.sh always runs through pytest -n auto --dist loadgroup. The loadgroup distribution keeps tests from the same module on the same worker, which matters for shared module-level fixtures.
Commit messages
History uses gitmoji-style prefixes. A skim of recent commits:
📝 Update release notes
💄 Improve layout and styling (#15462)
⬆ Bump sqlmodel from 0.0.32 to 0.0.38 (#15437)
🐛 ...
✨ ...
🔧 ...The release-notes commits are produced by .github/workflows/latest-changes.yml and follow up on merged PRs; do not hand-edit them.
CI surface
.github/workflows/ runs on every PR:
| Workflow | What it checks |
|---|---|
test.yml |
Pytest matrix across supported Python versions; runs scripts/test.sh and posts coverage. |
pre-commit.yml |
Runs prek (pre-commit-compatible) — lint + format + assorted hooks. |
build-docs.yml |
Builds the multi-language MkDocs site to verify edits. |
test-redistribute.yml |
Builds both fastapi and fastapi-slim distributions, installs each in a fresh env, runs tests against the installed wheel. |
smokeshow.yml |
Uploads the coverage report and surfaces it on PRs. |
notify-translations.yml, translate.yml, people.yml, sponsors.yml, topic-repos.yml, contributors.yml |
Bot-driven workflows that maintain auto-generated docs pages. |
Hot tips
bash scripts/test.sh -xhalts on the first failure.pyproject.tomlhasfilterwarnings = ["error"]. A bumped dependency that introduces a newDeprecationWarningwill fail tests until either the dependency is pinned or the warning is filtered.scripts/docs.py liveruns MkDocs with reload while you edit.scripts/docs.py live esswitches language.fastapi-slim/is a sibling distribution that mirrorsfastapi/— when changingpyproject.toml, check whetherfastapi-slim/pyproject.tomlneeds the same edit.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Previous
How to contribute
Next
Testing