Browse Source

♻️ Update mypy (#11049)

Co-authored-by: Sebastián Ramírez <[email protected]>
pull/11391/head
Aleksei Kotenko 1 year ago
committed by GitHub
parent
commit
9c80842cea
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      fastapi/applications.py
  2. 2
      fastapi/background.py
  3. 2
      fastapi/datastructures.py
  4. 2
      fastapi/encoders.py
  5. 2
      fastapi/exceptions.py
  6. 2
      fastapi/openapi/docs.py
  7. 2
      fastapi/param_functions.py
  8. 2
      fastapi/routing.py
  9. 2
      fastapi/security/api_key.py
  10. 2
      fastapi/security/http.py
  11. 2
      fastapi/security/oauth2.py
  12. 2
      fastapi/security/open_id_connect_url.py
  13. 2
      requirements-tests.txt

2
fastapi/applications.py

@ -40,7 +40,7 @@ from starlette.requests import Request
from starlette.responses import HTMLResponse, JSONResponse, Response from starlette.responses import HTMLResponse, JSONResponse, Response
from starlette.routing import BaseRoute from starlette.routing import BaseRoute
from starlette.types import ASGIApp, Lifespan, Receive, Scope, Send 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") AppType = TypeVar("AppType", bound="FastAPI")

2
fastapi/background.py

@ -1,7 +1,7 @@
from typing import Any, Callable from typing import Any, Callable
from starlette.background import BackgroundTasks as StarletteBackgroundTasks 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") P = ParamSpec("P")

2
fastapi/datastructures.py

@ -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 QueryParams as QueryParams # noqa: F401
from starlette.datastructures import State as State # noqa: F401 from starlette.datastructures import State as State # noqa: F401
from starlette.datastructures import UploadFile as StarletteUploadFile 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): class UploadFile(StarletteUploadFile):

2
fastapi/encoders.py

@ -22,7 +22,7 @@ from pydantic import BaseModel
from pydantic.color import Color from pydantic.color import Color
from pydantic.networks import AnyUrl, NameEmail from pydantic.networks import AnyUrl, NameEmail
from pydantic.types import SecretBytes, SecretStr 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 from ._compat import PYDANTIC_V2, Url, _model_dump

2
fastapi/exceptions.py

@ -3,7 +3,7 @@ from typing import Any, Dict, Optional, Sequence, Type, Union
from pydantic import BaseModel, create_model from pydantic import BaseModel, create_model
from starlette.exceptions import HTTPException as StarletteHTTPException from starlette.exceptions import HTTPException as StarletteHTTPException
from starlette.exceptions import WebSocketException as StarletteWebSocketException 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): class HTTPException(StarletteHTTPException):

2
fastapi/openapi/docs.py

@ -3,7 +3,7 @@ from typing import Any, Dict, Optional
from fastapi.encoders import jsonable_encoder from fastapi.encoders import jsonable_encoder
from starlette.responses import HTMLResponse 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[ swagger_ui_default_parameters: Annotated[
Dict[str, Any], Dict[str, Any],

2
fastapi/param_functions.py

@ -3,7 +3,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Union
from fastapi import params from fastapi import params
from fastapi._compat import Undefined from fastapi._compat import Undefined
from fastapi.openapi.models import Example 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 _Unset: Any = Undefined

2
fastapi/routing.py

@ -69,7 +69,7 @@ from starlette.routing import (
from starlette.routing import Mount as Mount # noqa from starlette.routing import Mount as Mount # noqa
from starlette.types import ASGIApp, Lifespan, Scope from starlette.types import ASGIApp, Lifespan, Scope
from starlette.websockets import WebSocket 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( def _prepare_response_content(

2
fastapi/security/api_key.py

@ -5,7 +5,7 @@ from fastapi.security.base import SecurityBase
from starlette.exceptions import HTTPException from starlette.exceptions import HTTPException
from starlette.requests import Request from starlette.requests import Request
from starlette.status import HTTP_403_FORBIDDEN 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): class APIKeyBase(SecurityBase):

2
fastapi/security/http.py

@ -10,7 +10,7 @@ from fastapi.security.utils import get_authorization_scheme_param
from pydantic import BaseModel from pydantic import BaseModel
from starlette.requests import Request from starlette.requests import Request
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN 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): class HTTPBasicCredentials(BaseModel):

2
fastapi/security/oauth2.py

@ -10,7 +10,7 @@ from starlette.requests import Request
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
# TODO: import from typing when deprecating Python 3.9 # 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: class OAuth2PasswordRequestForm:

2
fastapi/security/open_id_connect_url.py

@ -5,7 +5,7 @@ from fastapi.security.base import SecurityBase
from starlette.exceptions import HTTPException from starlette.exceptions import HTTPException
from starlette.requests import Request from starlette.requests import Request
from starlette.status import HTTP_403_FORBIDDEN 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): class OpenIdConnect(SecurityBase):

2
requirements-tests.txt

@ -3,7 +3,7 @@
pydantic-settings >=2.0.0 pydantic-settings >=2.0.0
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.4.1 mypy ==1.8.0
ruff ==0.2.0 ruff ==0.2.0
email_validator >=1.1.1,<3.0.0 email_validator >=1.1.1,<3.0.0
dirty-equals ==0.6.0 dirty-equals ==0.6.0

Loading…
Cancel
Save