mirror of https://github.com/tiangolo/fastapi.git
♻️ Update mypy (#11049)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
1fcf3884e1
commit
9c80842cea
|
|
@ -40,7 +40,7 @@ from starlette.requests import Request
|
|||
from starlette.responses import HTMLResponse, JSONResponse, Response
|
||||
from starlette.routing import BaseRoute
|
||||
from starlette.types import ASGIApp, Lifespan, Receive, Scope, Send
|
||||
from typing_extensions import Annotated, Doc, deprecated # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc, deprecated
|
||||
|
||||
AppType = TypeVar("AppType", bound="FastAPI")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from typing import Any, Callable
|
||||
|
||||
from starlette.background import BackgroundTasks as StarletteBackgroundTasks
|
||||
from typing_extensions import Annotated, Doc, ParamSpec # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc, ParamSpec
|
||||
|
||||
P = ParamSpec("P")
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from starlette.datastructures import Headers as Headers # noqa: F401
|
|||
from starlette.datastructures import QueryParams as QueryParams # noqa: F401
|
||||
from starlette.datastructures import State as State # noqa: F401
|
||||
from starlette.datastructures import UploadFile as StarletteUploadFile
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
|
||||
class UploadFile(StarletteUploadFile):
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from pydantic import BaseModel
|
|||
from pydantic.color import Color
|
||||
from pydantic.networks import AnyUrl, NameEmail
|
||||
from pydantic.types import SecretBytes, SecretStr
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
from ._compat import PYDANTIC_V2, Url, _model_dump
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from typing import Any, Dict, Optional, Sequence, Type, Union
|
|||
from pydantic import BaseModel, create_model
|
||||
from starlette.exceptions import HTTPException as StarletteHTTPException
|
||||
from starlette.exceptions import WebSocketException as StarletteWebSocketException
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
|
||||
class HTTPException(StarletteHTTPException):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from typing import Any, Dict, Optional
|
|||
|
||||
from fastapi.encoders import jsonable_encoder
|
||||
from starlette.responses import HTMLResponse
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
swagger_ui_default_parameters: Annotated[
|
||||
Dict[str, Any],
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Union
|
|||
from fastapi import params
|
||||
from fastapi._compat import Undefined
|
||||
from fastapi.openapi.models import Example
|
||||
from typing_extensions import Annotated, Doc, deprecated # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc, deprecated
|
||||
|
||||
_Unset: Any = Undefined
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ from starlette.routing import (
|
|||
from starlette.routing import Mount as Mount # noqa
|
||||
from starlette.types import ASGIApp, Lifespan, Scope
|
||||
from starlette.websockets import WebSocket
|
||||
from typing_extensions import Annotated, Doc, deprecated # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc, deprecated
|
||||
|
||||
|
||||
def _prepare_response_content(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from fastapi.security.base import SecurityBase
|
|||
from starlette.exceptions import HTTPException
|
||||
from starlette.requests import Request
|
||||
from starlette.status import HTTP_403_FORBIDDEN
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
|
||||
class APIKeyBase(SecurityBase):
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from fastapi.security.utils import get_authorization_scheme_param
|
|||
from pydantic import BaseModel
|
||||
from starlette.requests import Request
|
||||
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
|
||||
class HTTPBasicCredentials(BaseModel):
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from starlette.requests import Request
|
|||
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
|
||||
|
||||
# TODO: import from typing when deprecating Python 3.9
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
|
||||
class OAuth2PasswordRequestForm:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from fastapi.security.base import SecurityBase
|
|||
from starlette.exceptions import HTTPException
|
||||
from starlette.requests import Request
|
||||
from starlette.status import HTTP_403_FORBIDDEN
|
||||
from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
|
||||
from typing_extensions import Annotated, Doc
|
||||
|
||||
|
||||
class OpenIdConnect(SecurityBase):
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
pydantic-settings >=2.0.0
|
||||
pytest >=7.1.3,<8.0.0
|
||||
coverage[toml] >= 6.5.0,< 8.0
|
||||
mypy ==1.4.1
|
||||
mypy ==1.8.0
|
||||
ruff ==0.2.0
|
||||
email_validator >=1.1.1,<3.0.0
|
||||
dirty-equals ==0.6.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue