Skip to content

Upgrading starlette 0.2 to 0.3

Unknown0.2.3 → 0.3.7

UnknownUpgrade verdict

DepDelta hasn't looked for this range's notes yet, so breaking changes can't be ruled out.

  • DepDelta hasn't finished looking for the notes in this range, so it can't rule out breaking changes yet.
  • Their commits are listed with this comparison.
Unknown for releases without notes

Releases without notes may still need changes. Check their commits before upgrading.

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

  • removed: export App
  • removed: export FileResponse
  • removed: export HTMLResponse
  • removed: export JSONResponse
  • removed: export PlainTextResponse
  • removed: export RedirectResponse
  • removed: export Request
  • removed: export Response
  • removed: export StreamingResponse
  • removed: export TestClient
  • removed: class App
  • removed: constructor App(debug=…) -> None
  • removed: function request_response(func)
  • removed: function websocket_session(func)
  • removed: method App.add_exception_handler(exc_class: type, handler) -> None
  • removed: method App.add_route(path: str, route, methods=…) -> None
  • removed: method App.add_websocket_route(path: str, route) -> None
  • removed: method App.exception_handler(exc_class: type)
  • removed: method App.mount(path: str, app: ASGIApp, methods=…) -> None
  • removed: method App.route(path: str)
  • removed: method App.websocket_route(path: str)
  • removed: property App.debug -> bool
  • added: class Starlette
  • added: constructor Starlette(debug=…) -> None
  • added: function request_response(func)
  • added: function websocket_session(func)
  • added: method Starlette.add_exception_handler(exc_class: type, handler) -> None
  • added: method Starlette.add_middleware(middleware_class: type, **kwargs: typing.Any) -> None
  • added: method Starlette.add_route(path: str, route, methods=…) -> None
  • added: method Starlette.add_websocket_route(path: str, route) -> None
  • added: method Starlette.exception_handler(exc_class: type)
  • added: method Starlette.mount(path: str, app: ASGIApp, methods=…) -> None
  • added: method Starlette.on_event(event_type: str)
  • added: method Starlette.route(path: str, methods=…)
  • added: method Starlette.websocket_route(path: str)
  • added: property Starlette.debug -> bool
  • added: class BackgroundTask
  • added: constructor BackgroundTask(func, *args, **kwargs)
  • removed: property URL.components
  • removed: property URL.fragment
  • removed: property URL.hostname
  • removed: property URL.netloc
  • removed: property URL.params
  • removed: property URL.password
  • removed: property URL.path
  • removed: property URL.port
  • removed: property URL.query
  • removed: property URL.scheme
  • removed: property URL.username
  • changed: class QueryParams(typing.Mapping[str, str]) → class QueryParams(StrDict)
  • changed: class URL(str) → class URL
  • changed: constructor Headers(raw_headers=…) -> None → constructor Headers(raw_headers: typing.Optional[BytesPairs]=…) -> None
  • changed: method Headers.get(key: str, default: str=…) → method Headers.get(key: str, default: typing.Any=…) -> typing.Any
  • changed: method Headers.items() → method Headers.items() -> StrPairs
  • changed: method Headers.keys() → method Headers.keys() -> typing.List[str]
  • changed: method Headers.mutablecopy() → method Headers.mutablecopy() -> MutableHeaders
  • changed: method Headers.values() → method Headers.values() -> typing.List[str]
  • changed: method MutableHeaders.setdefault(key: str, value: str) → method MutableHeaders.setdefault(key: str, value: str) -> str
  • changed: method QueryParams.get(key, default=…) → method QueryParams.get(key: typing.Any, default: typing.Any=…) -> typing.Any
  • changed: method QueryParams.getlist(key: str) -> typing.List[str] → method QueryParams.getlist(key: typing.Any) -> typing.List[str]
  • changed: method QueryParams.items() → method QueryParams.items() -> StrPairs
  • changed: method QueryParams.keys() → method QueryParams.keys() -> typing.List[str]
  • changed: method QueryParams.values() → method QueryParams.values() -> typing.List[str]
  • changed: method URL.replace(**kwargs) → method URL.replace(**kwargs: typing.Any) -> URL
  • added: constructor URL(url: str=…, scope: Scope=…) -> None
  • added: method MutableHeaders.update(other: dict)
  • added: property URL.components -> ParseResult
  • added: property URL.fragment -> str
  • added: property URL.hostname -> typing.Union[None, str]
  • added: property URL.netloc -> str
  • added: property URL.params -> str
  • added: property URL.password -> typing.Union[None, str]
  • added: property URL.path -> str
  • added: property URL.port -> typing.Optional[int]
  • added: property URL.query -> str
  • added: property URL.scheme -> str
  • added: property URL.username -> typing.Union[None, str]
  • added: variable BytesPairs
  • changed: constructor DebugMiddleware(app) → constructor DebugMiddleware(app: ASGIApp) -> None
  • changed: function get_debug_response(request, exc) → function get_debug_response(request: Request, exc: Exception) -> Response
  • added: async method HTTPEndpoint.dispatch(request: Request, **kwargs: typing.Any) -> Response
  • added: async method HTTPEndpoint.method_not_allowed(request: Request, **kwargs: typing.Any) -> Response
  • added: async method WebSocketEndpoint.decode(websocket, message)
  • added: async method WebSocketEndpoint.on_connect(websocket, **kwargs)
  • added: async method WebSocketEndpoint.on_disconnect(websocket, close_code)
  • added: async method WebSocketEndpoint.on_receive(websocket, data)
  • added: class HTTPEndpoint
  • added: class WebSocketEndpoint
  • added: constructor HTTPEndpoint(scope: Scope) -> None
  • added: constructor WebSocketEndpoint(scope: Scope) -> None
  • added: field WebSocketEndpoint.encoding
  • changed: method ExceptionMiddleware.http_exception(request: Request, exc: type) -> Response → method ExceptionMiddleware.http_exception(request: Request, exc: HTTPException) -> Response
  • changed: method ExceptionMiddleware.server_error(request: Request, exc: type) -> Response → method ExceptionMiddleware.server_error(request: Request, exc: HTTPException) -> Response
  • added: async method LifespanContext.receive()
  • added: async method LifespanContext.run_lifespan()
  • added: async method LifespanContext.send(message)
  • added: async method LifespanContext.wait_cleanup()
  • added: async method LifespanContext.wait_startup()
  • added: async method LifespanHandler.run_cleanup() -> None
  • added: async method LifespanHandler.run_lifespan(receive, send)
  • added: async method LifespanHandler.run_startup() -> None
  • added: class LifespanContext
  • added: class LifespanHandler
  • added: constructor LifespanContext(app, startup_timeout=…, cleanup_timeout=…)
  • added: constructor LifespanHandler()
  • added: method LifespanHandler.on_event(event_type: str)
  • added: variable STATE_TRANSITION_ERROR
  • added: async method CORSMiddleware.send(message, send=…, origin=…)
  • added: async method CORSMiddleware.simple_response(receive, send, scope=…, origin=…)
  • added: class CORSMiddleware
  • added: 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=…, expose_headers: typing.Sequence[str]=…, max_age: int=…)
  • added: method CORSMiddleware.is_allowed_origin(origin)
  • added: method CORSMiddleware.preflight_response(request_headers)
  • added: variable ALL_METHODS
  • added: class HTTPSRedirectMiddleware
  • added: constructor HTTPSRedirectMiddleware(app: ASGIApp) -> None
  • added: class TrustedHostMiddleware
  • added: constructor TrustedHostMiddleware(app: ASGIApp, allowed_hosts: typing.Sequence[str]=…) -> None
  • removed: async method Request.body()
  • removed: async method Request.json()
  • removed: async method Request.stream()
  • removed: class ClientDisconnect(Exception)
  • removed: class Request(Mapping)
  • removed: constructor Request(scope, receive=…)
  • removed: property Request.headers -> Headers
  • removed: property Request.method -> str
  • removed: property Request.query_params -> QueryParams
  • removed: property Request.url -> URL
  • added: async method Request.body() -> bytes
  • added: async method Request.json() -> typing.Any
  • added: async method Request.stream() -> typing.AsyncGenerator[bytes, None]
  • added: class ClientDisconnect(Exception)
  • added: class Request(Mapping)
  • added: constructor Request(scope: Scope, receive: Receive=…) -> None
  • added: property Request.cookies -> typing.Dict[str, str]
  • added: property Request.headers -> Headers
  • added: property Request.method -> str
  • added: property Request.query_params -> QueryParams
  • added: property Request.url -> URL
  • removed: class FileResponse(Response)
  • removed: class HTMLResponse(Response)
  • removed: class JSONResponse(Response)
  • removed: class PlainTextResponse(Response)
  • removed: class RedirectResponse(Response)
  • removed: class Response
  • removed: class StreamingResponse(Response)
  • removed: constructor FileResponse(path: str, headers: dict=…, media_type: str=…, filename: str=…, stat_result: os.stat_result=…) -> None
  • removed: constructor RedirectResponse(url: str, status_code: int=…, headers: dict=…) -> None
  • removed: constructor Response(content: typing.Any, status_code: int=…, headers: dict=…, media_type: str=…) -> None
  • removed: constructor StreamingResponse(content: typing.Any, status_code: int=…, headers: dict=…, media_type: str=…) -> None
  • removed: field FileResponse.chunk_size
  • removed: field HTMLResponse.media_type
  • removed: field JSONResponse.media_type
  • removed: field JSONResponse.options
  • removed: field PlainTextResponse.media_type
  • removed: field Response.charset
  • removed: field Response.media_type
  • removed: method FileResponse.set_stat_headers(stat_result)
  • removed: method JSONResponse.render(content: typing.Any) -> bytes
  • removed: method Response.init_headers(headers)
  • removed: method Response.render(content: typing.Any) -> bytes
  • removed: property Response.headers
  • added: class FileResponse(Response)
  • added: class HTMLResponse(Response)
  • added: class JSONResponse(Response)
  • added: class PlainTextResponse(Response)
  • added: class RedirectResponse(Response)
  • added: class Response
  • added: class StreamingResponse(Response)
  • added: constructor FileResponse(path: str, headers: dict=…, media_type: str=…, filename: str=…, stat_result: os.stat_result=…) -> None
  • added: constructor RedirectResponse(url: typing.Union[str, URL], status_code: int=…, headers: dict=…) -> None
  • added: constructor Response(content: typing.Any, status_code: int=…, headers: dict=…, media_type: str=…, background: BackgroundTask=…) -> None
  • added: constructor StreamingResponse(content: typing.Any, status_code: int=…, headers: dict=…, media_type: str=…) -> None
  • added: field FileResponse.chunk_size
  • added: field HTMLResponse.media_type
  • added: field JSONResponse.media_type
  • added: field PlainTextResponse.media_type
  • added: field Response.charset
  • added: field Response.media_type
  • added: method FileResponse.set_stat_headers(stat_result)
  • added: method JSONResponse.render(content: typing.Any) -> bytes
  • added: method Response.delete_cookie(key: str, path: str=…, domain: str=…) -> None
  • added: method Response.init_headers(headers) -> None
  • added: method Response.render(content: typing.Any) -> bytes
  • added: method Response.set_cookie(key: str, value: str=…, max_age: int=…, expires: int=…, path: str=…, domain: str=…, secure: bool=…, httponly: bool=…) -> None
  • added: property Response.headers -> MutableHeaders
  • added: variable JSON_DUMPS_OPTIONS
  • added: variable aio_stat
  • added: variable aiofiles
  • changed: constructor ProtocolRouter(protocols: typing.Dict[str, ASGIApp]) → constructor ProtocolRouter(protocols: typing.Dict[str, ASGIApp]) -> None
  • changed: constructor StaticFile(*, path) → constructor StaticFile(*, path: str) -> None
  • changed: constructor StaticFiles(*, directory) → constructor StaticFiles(*, directory: str) -> None
  • removed: async method View.dispatch(request: Request, **kwargs) -> Response
  • removed: async method View.method_not_allowed(request: Request, **kwargs) -> Response
  • removed: class View
  • removed: constructor View(scope: Scope)
  • removed: async method WebSocketSession.accept(subprotocol=…)
  • removed: async method WebSocketSession.close(code=…)
  • removed: async method WebSocketSession.receive()
  • removed: async method WebSocketSession.receive_bytes()
  • removed: async method WebSocketSession.receive_json()
  • removed: async method WebSocketSession.receive_text()
  • removed: async method WebSocketSession.send(message)
  • removed: async method WebSocketSession.send_bytes(data)
  • removed: async method WebSocketSession.send_json(data)
  • removed: async method WebSocketSession.send_text(data)
  • removed: class WebSocketSession(Mapping)
  • removed: constructor WebSocketSession(scope, receive=…, send=…)
  • removed: property WebSocketSession.headers -> Headers
  • removed: property WebSocketSession.query_params -> QueryParams
  • removed: property WebSocketSession.url -> URL
  • changed: constructor WebSocketClose(code=…) → constructor WebSocketClose(code: int=…) -> None
  • changed: constructor WebSocketDisconnect(code=…) → constructor WebSocketDisconnect(code: int=…) -> None
  • added: async method WebSocket.accept(subprotocol: typing.List[str]=…) -> None
  • added: async method WebSocket.close(code: int=…) -> None
  • added: async method WebSocket.receive() -> Message
  • added: async method WebSocket.receive_bytes() -> bytes
  • added: async method WebSocket.receive_json() -> typing.Any
  • added: async method WebSocket.receive_text() -> str
  • added: async method WebSocket.send(message: Message) -> None
  • added: async method WebSocket.send_bytes(data: bytes) -> None
  • added: async method WebSocket.send_json(data: typing.Any) -> None
  • added: async method WebSocket.send_text(data: str) -> None
  • added: class WebSocket(Mapping)
  • added: constructor WebSocket(scope: Scope, receive: Receive, send: Send) -> None
  • added: property WebSocket.headers -> Headers
  • added: property WebSocket.query_params -> QueryParams
  • added: property WebSocket.url -> URL