Factory.ai

Open-Source Wikis

/

FastAPI

/

How to contribute

/

Development workflow

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.sh

scripts/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 -x halts on the first failure.
  • pyproject.toml has filterwarnings = ["error"]. A bumped dependency that introduces a new DeprecationWarning will fail tests until either the dependency is pinned or the warning is filtered.
  • scripts/docs.py live runs MkDocs with reload while you edit. scripts/docs.py live es switches language.
  • fastapi-slim/ is a sibling distribution that mirrors fastapi/ — when changing pyproject.toml, check whether fastapi-slim/pyproject.toml needs the same edit.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Development workflow – FastAPI wiki | Factory