Skip to content

Upgrading starlette 0.25 to 0.26

Breaking0.25.0 → 0.26.1Breaking1Deprecated1New1Fixed2Other1

BreakingUpgrade verdict

1 breaking change.

  • Code that calls url_for now gets a URL object back instead of a plain string.
  • The on_startup and on_shutdown hooks are deprecated in favor of lifespan handlers.
2 items need code or config changes
Breaking1
Changes the url_for signature to return a URL instance.
url_forURL
Deprecated1
Deprecates on_startup and on_shutdown events.
on_startupon_shutdown

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

  • changed: method Starlette.url_path_for(name: str, **path_params: typing.Any) -> URLPath → method Starlette.url_path_for(__name: str, **path_params: typing.Any) -> URLPath
  • added: variable AppType
  • changed: method URLPath.make_absolute_url(base_url: typing.Union[str, URL]) -> str → method URLPath.make_absolute_url(base_url: typing.Union[str, URL]) -> URL
  • changed: method HTTPConnection.url_for(name: str, **path_params: typing.Any) -> str → method HTTPConnection.url_for(__name: str, **path_params: typing.Any) -> URL
  • changed: constructor Router(routes: typing.Optional[typing.Sequence[BaseRoute]]=…, redirect_slashes: bool=…, default: typing.Optional[ASGIApp]=…, on_startup: typing.Optional[typing.Sequence[typing.Callable]]=…, on_shutdown: typing.Optional[typing.Sequence[typing.Callable]]=…, lifespan: typing.Optional[typing.Callable[[typing.Any], typing.AsyncContextManager]]=…) -> None → constructor Router(routes: typing.Optional[typing.Sequence[BaseRoute]]=…, redirect_slashes: bool=…, default: typing.Optional[ASGIApp]=…, on_startup: typing.Optional[typing.Sequence[typing.Callable]]=…, on_shutdown: typing.Optional[typing.Sequence[typing.Callable]]=…, lifespan: typing.Optional[Lifespan[typing.Any]]=…) -> None
  • changed: method BaseRoute.url_path_for(name: str, **path_params: typing.Any) -> URLPath → method BaseRoute.url_path_for(__name: str, **path_params: typing.Any) -> URLPath
  • changed: method Host.url_path_for(name: str, **path_params: typing.Any) -> URLPath → method Host.url_path_for(__name: str, **path_params: typing.Any) -> URLPath
  • changed: method Mount.url_path_for(name: str, **path_params: typing.Any) -> URLPath → method Mount.url_path_for(__name: str, **path_params: typing.Any) -> URLPath
  • changed: method Route.url_path_for(name: str, **path_params: typing.Any) -> URLPath → method Route.url_path_for(__name: str, **path_params: typing.Any) -> URLPath
  • changed: method Router.url_path_for(name: str, **path_params: typing.Any) -> URLPath → method Router.url_path_for(__name: str, **path_params: typing.Any) -> URLPath
  • changed: method WebSocketRoute.url_path_for(name: str, **path_params: typing.Any) -> URLPath → method WebSocketRoute.url_path_for(__name: str, **path_params: typing.Any) -> URLPath
  • added: variable AppType
  • added: variable Lifespan
  • added: variable StatefulLifespan
  • added: variable StatelessLifespan