mirror of
https://github.com/fastapi/fastapi.git
synced 2026-04-04 23:23:38 -04:00
♻️ Update type annotations for improved python-multipart (#12407)
This commit is contained in:
committed by
GitHub
parent
fcb15b4db1
commit
40490abaa3
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user