♻️ Update type annotations for improved `python-multipart` (#12407)

This commit is contained in:
Sebastián Ramírez 2024-10-08 12:55:26 +02:00 committed by GitHub
parent fcb15b4db1
commit 40490abaa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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