Skip to content

Upgrading starlette 0.36 to 0.37

Safe0.36.3 → 0.37.2New2Fixed3

SafeUpgrade verdict

Only new features and fixes in this range.

  • Nothing in this range needs changes to your code. It adds features and fixes.
Nothing to change

No breaking, platform, security or deprecated items in this range.

Nothing in this upgrade needs a code or configuration change.

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • changed: method Starlette.add_exception_handler(exc_class_or_status_code: int | typing.Type[Exception], handler: ExceptionHandler) -> None → method Starlette.add_exception_handler(exc_class_or_status_code: int | type[Exception], handler: ExceptionHandler) -> None
  • changed: method Starlette.add_middleware(middleware_class: typing.Type[_MiddlewareClass[P]], *args: P.args, **kwargs: P.kwargs) -> None → method Starlette.add_middleware(middleware_class: type[_MiddlewareClass[P]], *args: P.args, **kwargs: P.kwargs) -> None
  • changed: method Starlette.add_route(path: str, route: typing.Callable[[Request], typing.Awaitable[Response] | Response], methods: typing.Optional[typing.List[str]]=…, name: typing.Optional[str]=…, include_in_schema: bool=…) -> None → method Starlette.add_route(path: str, route: typing.Callable[[Request], typing.Awaitable[Response] | Response], methods: list[str] | None=…, name: str | None=…, include_in_schema: bool=…) -> None
  • changed: method Starlette.exception_handler(exc_class_or_status_code: int | typing.Type[Exception]) -> typing.Callable → method Starlette.exception_handler(exc_class_or_status_code: int | type[Exception]) -> typing.Callable
  • changed: variable CONVERTOR_TYPES: typing.Dict[str, Convertor[typing.Any]] → variable CONVERTOR_TYPES: dict[str, Convertor[typing.Any]]
  • changed: constructor ImmutableMultiDict(*args: ImmutableMultiDict[_KeyType, _CovariantValueType] | typing.Mapping[_KeyType, _CovariantValueType] | typing.Iterable[typing.Tuple[_KeyType, _CovariantValueType]], **kwargs: typing.Any) -> None → constructor ImmutableMultiDict(*args: ImmutableMultiDict[_KeyType, _CovariantValueType] | typing.Mapping[_KeyType, _CovariantValueType] | typing.Iterable[tuple[_KeyType, _CovariantValueType]], **kwargs: typing.Any) -> None
  • changed: constructor AuthenticationMiddleware(app: ASGIApp, backend: AuthenticationBackend, on_error: typing.Optional[typing.Callable[[HTTPConnection, AuthenticationError], Response]]=…) -> None → constructor AuthenticationMiddleware(app: ASGIApp, backend: AuthenticationBackend, on_error: typing.Callable[[HTTPConnection, AuthenticationError], Response] | None=…) -> None
  • changed: constructor BaseHTTPMiddleware(app: ASGIApp, dispatch: typing.Optional[DispatchFunction]=…) -> None → constructor BaseHTTPMiddleware(app: ASGIApp, dispatch: DispatchFunction | None=…) -> None
  • changed: constructor CORSMiddleware(app: ASGIApp, allow_origins: typing.Sequence[str]=…, allow_methods: typing.Sequence[str]=…, allow_headers: typing.Sequence[str]=…, allow_credentials: bool=…, allow_origin_regex: typing.Optional[str]=…, expose_headers: typing.Sequence[str]=…, max_age: int=…) -> None → constructor CORSMiddleware(app: ASGIApp, allow_origins: typing.Sequence[str]=…, allow_methods: typing.Sequence[str]=…, allow_headers: typing.Sequence[str]=…, allow_credentials: bool=…, allow_origin_regex: str | None=…, expose_headers: typing.Sequence[str]=…, max_age: int=…) -> None
  • changed: constructor ServerErrorMiddleware(app: ASGIApp, handler: typing.Optional[typing.Callable[[Request, Exception], typing.Any]]=…, debug: bool=…) -> None → constructor ServerErrorMiddleware(app: ASGIApp, handler: typing.Callable[[Request, Exception], typing.Any] | None=…, debug: bool=…) -> None
  • changed: constructor ExceptionMiddleware(app: ASGIApp, handlers: typing.Optional[typing.Mapping[typing.Any, typing.Callable[[Request, Exception], Response]]]=…, debug: bool=…) -> None → constructor ExceptionMiddleware(app: ASGIApp, handlers: typing.Mapping[typing.Any, typing.Callable[[Request, Exception], Response]] | None=…, debug: bool=…) -> None
  • changed: method ExceptionMiddleware.add_exception_handler(exc_class_or_status_code: typing.Union[int, typing.Type[Exception]], handler: typing.Callable[[Request, Exception], Response]) -> None → method ExceptionMiddleware.add_exception_handler(exc_class_or_status_code: int | type[Exception], handler: typing.Callable[[Request, Exception], Response]) -> None
  • changed: constructor SessionMiddleware(app: ASGIApp, secret_key: typing.Union[str, Secret], session_cookie: str=…, max_age: typing.Optional[int]=…, path: str=…, same_site: typing.Literal['lax', 'strict', 'none']=…, https_only: bool=…, domain: typing.Optional[str]=…) -> None → constructor SessionMiddleware(app: ASGIApp, secret_key: str | Secret, session_cookie: str=…, max_age: int | None=…, path: str=…, same_site: typing.Literal['lax', 'strict', 'none']=…, https_only: bool=…, domain: str | None=…) -> None
  • changed: constructor TrustedHostMiddleware(app: ASGIApp, allowed_hosts: typing.Optional[typing.Sequence[str]]=…, www_redirect: bool=…) -> None → constructor TrustedHostMiddleware(app: ASGIApp, allowed_hosts: typing.Sequence[str] | None=…, www_redirect: bool=…) -> None
  • changed: function build_environ(scope: Scope, body: bytes) -> typing.Dict[str, typing.Any] → function build_environ(scope: Scope, body: bytes) -> dict[str, typing.Any]
  • changed: method WSGIResponder.start_response(status: str, response_headers: typing.List[typing.Tuple[str, str]], exc_info: typing.Any=…) -> None → method WSGIResponder.start_response(status: str, response_headers: list[tuple[str, str]], exc_info: typing.Any=…) -> None
  • changed: method WSGIResponder.wsgi(environ: typing.Dict[str, typing.Any], start_response: typing.Callable[..., typing.Any]) -> None → method WSGIResponder.wsgi(environ: dict[str, typing.Any], start_response: typing.Callable[..., typing.Any]) -> None
  • changed: function request_response(func: typing.Callable[[Request], typing.Union[typing.Awaitable[Response], Response]]) -> ASGIApp → function request_response(func: typing.Callable[[Request], typing.Awaitable[Response] | Response]) -> ASGIApp
  • changed: method Mount.matches(scope: Scope) -> typing.Tuple[Match, Scope] → method Mount.matches(scope: Scope) -> tuple[Match, Scope]
  • added: class WebSocketDenialResponse(httpx.Response, WebSocketDisconnect)
  • changed: constructor WebSocketDisconnect(code: int=…, reason: typing.Optional[str]=…) -> None → constructor WebSocketDisconnect(code: int=…, reason: str | None=…) -> None
  • added: async method WebSocket.send_denial_response(response: Response) -> None
  • added: field WebSocketState.RESPONSE