From 40490abaa3526eee394eb84362bfa4ca6b4da9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 8 Oct 2024 12:55:26 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Update=20type=20annotation?= =?UTF-8?q?s=20for=20improved=20`python-multipart`=20(#12407)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/dependencies/utils.py | 6 +++--- requirements-docs-tests.txt | 2 ++ requirements-tests.txt | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index 5cebbf00f..813c74620 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -91,14 +91,14 @@ multipart_incorrect_install_error = ( def ensure_multipart_is_installed() -> None: try: # __version__ is available in both multiparts, and can be mocked - from multipart import __version__ # type: ignore + from multipart import __version__ assert __version__ try: # parse_options_header is only available in the right multipart - from multipart.multipart import parse_options_header # type: ignore + from multipart.multipart import parse_options_header - assert parse_options_header + assert parse_options_header # type: ignore[truthy-function] except ImportError: logger.error(multipart_incorrect_install_error) raise RuntimeError(multipart_incorrect_install_error) from None diff --git a/requirements-docs-tests.txt b/requirements-docs-tests.txt index b82df4933..40b956e51 100644 --- a/requirements-docs-tests.txt +++ b/requirements-docs-tests.txt @@ -1,2 +1,4 @@ # For mkdocstrings and tests httpx >=0.23.0,<0.25.0 +# For linting and generating docs versions +ruff ==0.6.4 diff --git a/requirements-tests.txt b/requirements-tests.txt index 2f2576dd5..7b1f7ea1a 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -3,7 +3,6 @@ pytest >=7.1.3,<8.0.0 coverage[toml] >= 6.5.0,< 8.0 mypy ==1.8.0 -ruff ==0.6.4 dirty-equals ==0.6.0 # TODO: once removing databases from tutorial, upgrade SQLAlchemy # probably when including SQLModel