mirror of https://github.com/tiangolo/fastapi.git
♻️ Update type annotations for improved `python-multipart` (#12407)
This commit is contained in:
parent
fcb15b4db1
commit
40490abaa3
|
|
@ -91,14 +91,14 @@ multipart_incorrect_install_error = (
|
||||||
def ensure_multipart_is_installed() -> None:
|
def ensure_multipart_is_installed() -> None:
|
||||||
try:
|
try:
|
||||||
# __version__ is available in both multiparts, and can be mocked
|
# __version__ is available in both multiparts, and can be mocked
|
||||||
from multipart import __version__ # type: ignore
|
from multipart import __version__
|
||||||
|
|
||||||
assert __version__
|
assert __version__
|
||||||
try:
|
try:
|
||||||
# parse_options_header is only available in the right multipart
|
# 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:
|
except ImportError:
|
||||||
logger.error(multipart_incorrect_install_error)
|
logger.error(multipart_incorrect_install_error)
|
||||||
raise RuntimeError(multipart_incorrect_install_error) from None
|
raise RuntimeError(multipart_incorrect_install_error) from None
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
# For mkdocstrings and tests
|
# For mkdocstrings and tests
|
||||||
httpx >=0.23.0,<0.25.0
|
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
|
pytest >=7.1.3,<8.0.0
|
||||||
coverage[toml] >= 6.5.0,< 8.0
|
coverage[toml] >= 6.5.0,< 8.0
|
||||||
mypy ==1.8.0
|
mypy ==1.8.0
|
||||||
ruff ==0.6.4
|
|
||||||
dirty-equals ==0.6.0
|
dirty-equals ==0.6.0
|
||||||
# TODO: once removing databases from tutorial, upgrade SQLAlchemy
|
# TODO: once removing databases from tutorial, upgrade SQLAlchemy
|
||||||
# probably when including SQLModel
|
# probably when including SQLModel
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue