Commit Graph

190 Commits

Author SHA1 Message Date
Sofie Van Landeghem a7ba9932ba
Expand test matrix to include Windows and MacOS (#14171)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-11 16:28:21 +01:00
Motov Yurii 9475024640
📝 Add variants for code examples in "Advanced User Guide" (#14413) 2025-12-10 09:55:32 +01:00
Ben Beasley 569226e753
⬆️ Bump Starlette to <`0.51.0` (#14282) 2025-11-19 12:55:05 +01:00
Motov Yurii 436932aef5
⬆️ Bump Starlette to <`0.50.0` (#14234) 2025-10-27 18:49:54 +01:00
Motov Yurii 96dd32718b
🔧 Add `license` and `license-files` to `pyproject.toml`, remove `License` from `classifiers` (#14230) 2025-10-27 15:45:14 +01:00
Sebastián Ramírez d390f2e41f
Migrate internal reference documentation from `typing_extensions.Doc` to `annotated_doc.Doc` (#14222) 2025-10-23 22:31:35 +02:00
Sofie Van Landeghem 3611c3fc5b
⬆️ Add support for Python 3.14 (#14165) 2025-10-10 11:44:39 +02:00
Neizvestnyj efdafa4361
📝 Update `tutorial/security/oauth2-jwt/` to use `pwdlib` with Argon2 instead of `passlib` (#13917)
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2025-09-29 04:57:38 +02:00
Sofie Van Landeghem fe4542279d
🚨 Install pydantic.mypy plugin (#14081) 2025-09-20 18:23:06 +02:00
Motov Yurii 805ab1be5b
📌 Pin `httpx` to `>=0.23.0,<1.0.0` (#14086) 2025-09-18 10:09:33 +02:00
Ben Beasley 7563579dc8
⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0 (#14077)
Co-authored-by: svlandeg <svlandeg@github.com>
2025-09-16 19:21:48 +02:00
Sebastián Ramírez cad6880fd9
⬆️ Upgrade Starlette supported version range to `>=0.40.0,<0.48.0` (#13884) 2025-07-11 18:15:27 +02:00
Sebastián Ramírez b083ccd250
Add support for deploying to FastAPI Cloud with `fastapi deploy` (#13870) 2025-07-07 17:00:35 +02:00
Ben Beasley cc1f5de03c
⬆️ Bump Starlette to allow up to 0.46.0: `>=0.40.0,<0.47.0` (#13426)
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2025-02-28 15:07:47 +01:00
Sebastián Ramírez bd106fc750
⬆️ Add support for Python 3.13 (#13274)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-29 18:02:27 +00:00
johnthagen abd05a6d30
🔧 Add Pydantic 2 trove classifier (#13199) 2025-01-22 18:24:58 +00:00
Daniel Kusy 49e82ed2ac
⬆️ Upgrade `python-multipart` to >=0.0.18 (#13219) 2025-01-22 18:23:13 +00:00
Marcelo Trylesinski 82c74789e8
⬆️ Bump Starlette to allow up to 0.45.0: `>=0.40.0,<0.46.0` (#13117) 2025-01-22 18:21:40 +00:00
Daniel Kusy 548f67d465
⬆️ Upgrade `jinja2` to >=3.1.5 (#13194) 2025-01-22 18:02:36 +00:00
Marcel Hellkamp c4f8143dea
⬆️ Upgrade Starlette to `>=0.40.0,<0.42.0` (#12469)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-10-22 15:19:56 +01:00
Sebastián Ramírez b77f2351d1
⬆️ Upgrade Starlette to `>=0.37.2,<0.41.0` (#12431) 2024-10-12 11:59:01 +02:00
Sebastián Ramírez 24b8f2668b
Add inline-snapshot for tests (#12189) 2024-09-11 22:49:55 +00:00
Sebastián Ramírez 4f1eb0cd9e
🔧 Update coverage config files (#12035) 2024-08-18 16:07:03 -05:00
Sebastián Ramírez 46412ff67d
🔊 Remove old ignore warnings (#11950) 2024-08-16 17:44:28 +00:00
Jiri Kuncar c81f575d0d
🔨 Specify `email-validator` dependency with dash (#11515)
Co-authored-by: svlandeg <svlandeg@github.com>
2024-08-16 11:50:01 -05:00
Sławomir Ehlert 0aaaed581e
⚙️ Record and show test coverage contexts (what test covers which line) (#11518)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-08-15 20:57:38 -05:00
Pierre V-F 0d92b42ff0
🔧 Add changelog URL to `pyproject.toml`, shows in PyPI (#11152)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-08-15 13:50:31 -05:00
Ben Beasley 5fd9ab9750
⬆️ Allow Starlette 0.38.x, update the pin to `>=0.37.2,<0.39.0` (#11876)
Co-authored-by: svlandeg <svlandeg@github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-08-15 10:51:33 -05:00
Sebastián Ramírez f3e49e5f4e
🔇 Ignore warning from attrs in Trio (#11949) 2024-08-04 18:23:14 +00:00
Sebastián Ramírez a25c92ceb9
♻️ Add support for `pip install "fastapi[standard]"` with standard dependencies and `python -m fastapi` (#11935)
* ♻️ Add support for `pip install "fastapi[standard]"` and make `fastapi` not include the optional standard dependencies

* 📝 Update docs to include new fastapi[standard]

*  Add new stub fastapi command that tells people to install fastapi[standard]

*  Add tests for new stub CLI

* 🔧 Add new command fastapi in main fastapi project, for when fastapi-cli is not installed

* ✏️ Fix types

* 📝 Add note about quotes when installing fastapi[standard]

* 📝 Update docs about standard extra dependencies

* ⬆️ Upgrade fastapi-cli
2024-08-02 01:03:05 -05:00
Sebastián Ramírez 221e59b0d1
🚚 Rename GitHub links from tiangolo/fastapi to fastapi/fastapi (#11913) 2024-07-29 18:35:07 -05:00
Sebastián Ramírez 4d3ef06029
Remove orjson and ujson from default dependencies (#11842) 2024-07-14 12:46:40 -05:00
Sebastián Ramírez d71be59217
Add FastAPI CLI, the new `fastapi` command (#11522) 2024-05-02 15:37:31 -07:00
Sebastián Ramírez ea1f2190d3
🔧 Add configs and setup for `fastapi-slim` including optional extras `fastapi-slim[standard]`, and `fastapi` including by default the same `standard` extras (#11503) 2024-04-29 23:38:13 -07:00
Sebastián Ramírez 41fcbc7d00
🔧 Migrate from Hatch to PDM for the internal build (#11498) 2024-04-29 16:48:42 -07:00
Rafael Barbosa 0cf5ad8619
⬆️ Upgrade Starlette to >=0.37.2,<0.38.0, remove Starlette filterwarning for internal tests (#11266) 2024-04-01 21:28:39 -05:00
Sebastián Ramírez d0fcfd0dff
🔧 Update Ruff config, add extra ignore rule from SQLModel (#11353) 2024-03-26 12:38:21 -05:00
Charlie Marsh 5ccc869fee
⬆️ Upgrade configuration for Ruff v0.2.0 (#11075) 2024-03-26 11:56:53 -05:00
Sebastián Ramírez 4a2be2abff
⬆️ Upgrade version of Starlette to `>= 0.36.3` (#11086) 2024-02-04 22:14:53 +01:00
Sebastián Ramírez 9d34ad0ee8
Merge pull request from GHSA-qf9m-vfgh-m389 2024-02-03 13:32:42 +01:00
Jiri Daněk 25646a5070
🔧 Fix Ruff configuration unintentionally enabling and re-disabling mccabe complexity check (#10893)
Fix mistake in Ruff configuration unintentionally enabling mccabe complexity check

Enabling "C" turns on complexity checks (C90, mccabe), which is unintended
Instead, enable "C4" to get flake8-comprehensions checks

See docs at https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-12 16:01:06 +01:00
Sebastián Ramírez 5e583199b3
⬆️ Upgrade Starlette to >=0.35.0,<0.36.0 (#10938) 2024-01-11 16:29:54 +01:00
Aliaksei Urbanski 07f8d31ec9
Add support for Python 3.12 (#10666)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-10 15:55:45 -05:00
Sebastián Ramírez c55f90df32
⬆️ Upgrade Starlette to `>=0.29.0,<0.33.0`, update docs and usage of templates with new Starlette arguments (#10846)
* 📝 Update docs for compatibility with Starlette 0.29.0 and new template arguments

* ⬆️ Upgrade Starlette to >=0.29.0,<0.33.0

* 📌 Remove AnyIO pin
2023-12-26 21:12:34 +01:00
Adrian Garcia Badaracco d633953f13
⬆️ Upgrade Starlette to 0.28.0 (#9636)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-12-26 20:03:07 +01:00
Sebastián Ramírez a4aa79e0b4
Add support for raising exceptions (including `HTTPException`) in dependencies with `yield` in the exit code, do not support them in background tasks (#10831)
* ♻️ Refactor dependency AsyncExitStack logic, exit dependencies after creating the response, before sending it

*  Update tests for dependencies exit, check they are finished before the response is sent

* 🔥 Remove ExitAsyncStackMiddleware as it's no longer needed

* 📝 Update docs for dependencies with yield

* 📝 Update release notes

* 📝 Add source examples for new dependencies with yield raising

*  Add tests for new dependencies raising after yield

* 📝 Update release notes
2023-12-25 18:57:35 +01:00
Sebastián Ramírez 2e14c69c31
👷 Adopt Ruff format (#10517)
* 🔧 Update pre-commit, use ruff format

* ⬆️ Upgrade dependencies, use Ruff for formatting

* 🔧 Update Ruff config

* 🔨 Update lint and format scripts, use Ruff

* 🎨 Format internals with Ruff

* 🎨 Format docs scripts

* 🎨 Format tests

* 🎨 Format extra commas in src for docs

* 📝 Update docs mentioning `@lru_cache()`, use `@lru_cache` instead to keep consistency with the format

* 🎨 Update src for docs, use plain `@lru_cache`

* 🎨 Update src for docs format and docs references
2023-10-25 00:26:06 +04:00
Sebastián Ramírez 05ca41cfd1
Add reference (code API) docs with PEP 727, add subclass with custom docstrings for `BackgroundTasks`, refactor docs structure (#10392)
*  Add mkdocstrings and griffe-typingdoc to dependencies

* 🔧 Add mkdocstrings configs to MkDocs

* 📝 Add first WIP reference page

* ⬆️ Upgrade typing-extensions to the minimum version including Doc()

* 📝 Add docs to FastAPI parameters

* 📝 Add docstrings for OpenAPI docs utils

* 📝 Add docstrings for security utils

* 📝 Add docstrings for UploadFile

* 📝 Update docstrings in FastAPI class

* 📝 Add docstrings for path operation methods

* 📝 Add docstring for jsonable_encoder

* 📝 Add docstrings for exceptions

* 📝 Add docstsrings for parameter functions

* 📝 Add docstrings for responses

* 📝 Add docstrings for APIRouter

* ♻️ Sub-class BackgroundTasks to document it with docstrings

* 📝 Update usage of background tasks in dependencies

*  Update tests with new deprecation warnings

* 📝 Add new reference docs

* 🔧 Update MkDocs with new reference docs

*  Update pytest fixture, deprecation is raised only once

* 🎨 Update format for types in exceptions.py

* ♻️ Update annotations in BackgroundTask, `Annotated` can't take ParamSpec's P.args or P.kwargs

* ✏️ Fix typos caught by @pawamoy

* 🔧 Update and fix MkDocstrings configs from @pawamoy tips

* 📝 Update reference docs

* ✏️ Fix typos found by @pawamoy

*  Add HTTPX as a dependency for docs, for the TestClient

* 🔧 Update MkDocs config, rename websockets reference

* 🔇 Add type-ignores for Doc as the stubs haven't been released for mypy

* 🔥 Remove duplicated deprecated notice

* 🔇 Remove typing error for unreleased stub in openapi/docs.py

*  Add tests for UploadFile for coverage

* ⬆️ Upgrade griffe-typingdoc==0.2.2

* 📝 Refactor docs structure

* 🔨 Update README generation with new index frontmatter and style

* 🔨 Update generation of languages, remove from top menu, keep in lang menu

* 📝 Add OpenAPI Pydantic models

* 🔨 Update docs script to not translate Reference and Release Notes

* 🔧 Add reference for OpenAPI models

* 🔧 Update MkDocs config for mkdocstrings insiders

* 👷 Install mkdocstring insiders in CI for docs

* 🐛 Fix MkDocstrings insiders install URL

*  Move dependencies shared by docs and tests to its own requirements file

* 👷 Update cache keys for test and docs dependencies

* 📝 Remove no longer needed __init__ placeholder docstrings

* 📝 Move docstring for APIRouter to the class level (not __init__ level)

* 🔥 Remove no longer needed dummy placeholder __init__ docstring
2023-10-18 16:36:40 +04:00
Sebastián Ramírez 2ba7586ff3
⬆️ Drop support for Python 3.7, require Python 3.8 or above (#10442)
* 📝 Update docs, require Python 3.8+, drop 3.7

* 🔧 Update pyproject.toml, drop support for Python 3.7, require Python 3.8+

* 👷 Update CI GitHub Actions, drop support for Python 3.7, require 3.8+

* 📝 Update docs' references to Python 3.6 and 3.7, use Python 3.8
2023-10-17 09:59:11 +04:00
Sebastián Ramírez e1a1a367a7
📌 Pin AnyIO to < 4.0.0 to handle an incompatibility while upgrading to Starlette 0.31.1 (#10194) 2023-09-02 19:03:43 +02:00