Upgrading starlette 0.8 to 0.9
Unknown0.8.8 ā 0.9.11
UnknownUpgrade verdict
DepDelta hasn't looked for this range's notes yet, so breaking changes can't be ruled out.
In plain terms
- 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.
Must act Unknown for releases without notes
Releases without notes may still need changes. Check their commits before upgrading.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
async method AuthenticationBackend.authenticate(request: Request) -> typing.Optional[typing.Tuple[AuthCredentials, BaseUser]] - added:
class AuthCredentials - added:
class AuthenticationBackend - added:
class AuthenticationError(Exception) - added:
class BaseUser - added:
class SimpleUser(BaseUser) - added:
class UnauthenticatedUser(BaseUser) - added:
constructor AuthCredentials(scopes: typing.Sequence[str]=ā¦) - added:
constructor SimpleUser(username: str) -> None - added:
function has_required_scope(request: Request, scopes: typing.Sequence[str]) -> bool - added:
function requires(scopes: typing.Union[str, typing.Sequence[str]], status_code: int=ā¦, redirect: str=ā¦) -> typing.Callable - added:
property BaseUser.display_name -> str - added:
property BaseUser.identity -> str - added:
property BaseUser.is_authenticated -> bool - added:
property SimpleUser.display_name -> str - added:
property SimpleUser.is_authenticated -> bool - added:
property UnauthenticatedUser.display_name -> str - added:
property UnauthenticatedUser.is_authenticated -> bool
- added:
class BackgroundTasks(BackgroundTask) - added:
constructor BackgroundTasks(tasks: typing.Sequence[BackgroundTask]=ā¦) - added:
method BackgroundTasks.add_task(func: typing.Callable, *args: typing.Any, **kwargs: typing.Any) -> None
- added:
class Config - added:
class Environ(MutableMapping) - added:
class EnvironError(Exception) - added:
class undefined - added:
constructor Config(env_file: str=ā¦, environ: typing.Mapping[str, str]=ā¦) -> None - added:
constructor Environ(environ: typing.MutableMapping=ā¦) - added:
method Config.get(key: str, cast: type=ā¦, default: typing.Any=ā¦) -> typing.Any - added:
variable environ
- added:
export DatabaseBackend - added:
export DatabaseSession - added:
export DatabaseTransaction - added:
export compile - added:
export transaction
- added:
async method DatabaseBackend.shutdown() -> None - added:
async method DatabaseBackend.startup() -> None - added:
async method DatabaseSession.execute(query: ClauseElement) -> None - added:
async method DatabaseSession.executemany(query: ClauseElement, values: list) -> None - added:
async method DatabaseSession.fetchall(query: ClauseElement) -> typing.Any - added:
async method DatabaseSession.fetchone(query: ClauseElement) -> typing.Any - added:
async method DatabaseSession.fetchval(query: ClauseElement, index: int=ā¦) -> typing.Any - added:
async method DatabaseTransaction.commit() -> None - added:
async method DatabaseTransaction.rollback() -> None - added:
async method DatabaseTransaction.start() -> None - added:
class DatabaseBackend - added:
class DatabaseSession - added:
class DatabaseTransaction - added:
function compile(query: ClauseElement, dialect: Dialect) -> typing.Tuple[str, list] - added:
function transaction(func: typing.Callable) -> typing.Callable - added:
method DatabaseBackend.session() -> DatabaseSession - added:
method DatabaseSession.transaction() -> DatabaseTransaction - added:
variable logger
- added:
async method PostgresBackend.shutdown() -> None - added:
async method PostgresBackend.startup() -> None - added:
async method PostgresSession.acquire_connection() -> asyncpg.Connection - added:
async method PostgresSession.execute(query: ClauseElement) -> None - added:
async method PostgresSession.executemany(query: ClauseElement, values: list) -> None - added:
async method PostgresSession.fetchall(query: ClauseElement) -> typing.Any - added:
async method PostgresSession.fetchone(query: ClauseElement) -> typing.Any - added:
async method PostgresSession.release_connection() -> None - added:
async method PostgresTransaction.commit() -> None - added:
async method PostgresTransaction.rollback() -> None - added:
async method PostgresTransaction.start() -> None - added:
class PostgresBackend(DatabaseBackend) - added:
class PostgresSession(DatabaseSession) - added:
class PostgresTransaction(DatabaseTransaction) - added:
constructor PostgresBackend(database_url: typing.Union[str, DatabaseURL]) -> None - added:
constructor PostgresSession(pool: asyncpg.pool.Pool, dialect: Dialect) - added:
constructor PostgresTransaction(session: PostgresSession) - added:
method PostgresBackend.get_dialect() -> Dialect - added:
method PostgresBackend.session() -> PostgresSession - added:
method PostgresSession.transaction() -> DatabaseTransaction
- removed:
property URL.components -> ParseResult - removed:
property URL.params -> str - changed:
constructor QueryParams(params: typing.Mapping[str, str]=ā¦, items: typing.List[typing.Tuple[str, str]]=ā¦, query_string: str=ā¦, scope: Scope=ā¦) -> None ā constructor QueryParams(params: typing.Union[QueryParams, typing.Mapping[str, str]]=ā¦, items: typing.List[typing.Tuple[str, str]]=ā¦, query_string: str=ā¦, scope: Scope=ā¦) -> None - added:
async method UploadFile.close() -> None - added:
async method UploadFile.read(size: int=ā¦) -> typing.Union[bytes, str] - added:
async method UploadFile.seek(offset: int) -> None - added:
async method UploadFile.write(data: typing.Union[bytes, str]) -> None - added:
class CommaSeparatedStrings(Sequence) - added:
class DatabaseURL(URL) - added:
class FormData(typing.Mapping[str, FormValue]) - added:
class Secret - added:
class UploadFile - added:
constructor CommaSeparatedStrings(value: typing.Union[str, typing.Sequence[str]]) - added:
constructor FormData(form: typing.Union[FormData, typing.Mapping[str, FormValue]]=ā¦, items: typing.List[typing.Tuple[str, FormValue]]=ā¦) -> None - added:
constructor Secret(value: str) - added:
constructor UploadFile(filename: str, file: typing.IO=ā¦) -> None - added:
method DatabaseURL.replace(**kwargs: typing.Any) -> URL - added:
method FormData.get(key: typing.Any, default: typing.Any=ā¦) -> typing.Any - added:
method FormData.getlist(key: typing.Any) -> typing.List[FormValue] - added:
method FormData.items() -> typing.List[typing.Tuple[str, FormValue]] - added:
method FormData.keys() -> typing.List[str] - added:
method FormData.multi_items() -> typing.List[typing.Tuple[str, FormValue]] - added:
method FormData.values() -> typing.List[FormValue] - added:
method QueryParams.multi_items() -> typing.List[typing.Tuple[str, str]] - added:
property DatabaseURL.database -> str - added:
property DatabaseURL.dialect -> str - added:
property DatabaseURL.driver -> str - added:
property URL.components -> SplitResult - added:
variable Address - added:
variable FormValue
- removed:
async method UploadFile.close() -> None - removed:
async method UploadFile.read(size: int=ā¦) -> bytes - removed:
async method UploadFile.seek(offset: int) -> None - removed:
async method UploadFile.setup() -> None - removed:
async method UploadFile.write(data: bytes) -> None - removed:
class UploadFile - removed:
constructor UploadFile(filename: str) -> None - removed:
method UploadFile.create_tempfile() -> None - changed:
async method FormParser.parse() -> typing.Dict[str, typing.Union[str, UploadFile]] ā async method FormParser.parse() -> FormData - changed:
async method MultiPartParser.parse() -> typing.Dict[str, typing.Union[str, UploadFile]] ā async method MultiPartParser.parse() -> FormData
- changed:
async method GraphQLApp.execute(query, variables=ā¦, operation_name=ā¦) ā async method GraphQLApp.execute(query, variables=ā¦, context=ā¦, operation_name=ā¦)
- removed:
async method LifespanContext.receive() -> Message - removed:
async method LifespanContext.run_lifespan() -> None - removed:
async method LifespanContext.send(message: Message) -> None - removed:
async method LifespanContext.wait_shutdown() -> None - removed:
async method LifespanContext.wait_startup() -> None - removed:
async method LifespanHandler.run_lifespan(receive: Receive, send: Send) -> None - removed:
async method LifespanHandler.run_shutdown() -> None - removed:
async method LifespanHandler.run_startup() -> None - removed:
class LifespanContext - removed:
class LifespanHandler - removed:
constructor LifespanContext(app: ASGIApp, startup_timeout: int=ā¦, shutdown_timeout: int=ā¦) -> None - removed:
constructor LifespanHandler() -> None - removed:
method LifespanHandler.add_event_handler(event_type: str, func: typing.Callable) -> None - removed:
method LifespanHandler.on_event(event_type: str) -> typing.Callable - removed:
variable STATE_TRANSITION_ERROR
- added:
async method AuthenticationMiddleware.asgi(receive: Receive, send: Send, scope: Scope) -> None - added:
class AuthenticationMiddleware - added:
constructor AuthenticationMiddleware(app: ASGIApp, backend: AuthenticationBackend, on_error: typing.Callable[[Request, AuthenticationError], Response]=ā¦) -> None - added:
static method AuthenticationMiddleware.default_on_error(request: Request, exc: Exception) -> Response
- added:
async method DatabaseMiddleware.shutdown() -> None - added:
async method DatabaseMiddleware.startup() -> None - added:
class DatabaseLifespan - added:
class DatabaseMiddleware - added:
constructor DatabaseLifespan(app: ASGIApp, scope: Scope, startup: typing.Callable, shutdown: typing.Callable) -> None - added:
constructor DatabaseMiddleware(app: ASGIApp, database_url: typing.Union[str, DatabaseURL], rollback_on_shutdown: bool) -> None - added:
method DatabaseMiddleware.get_backend(database_url: typing.Union[str, DatabaseURL]) -> DatabaseBackend
- removed:
class DebugGenerator - removed:
constructor DebugGenerator(exc: Exception) -> None - removed:
method DebugGenerator.generate_html() -> str - removed:
method DebugGenerator.generate_plain_text() -> str - removed:
static method DebugGenerator.gen_frame_html(frame: traceback.FrameSummary) -> str - added:
method ServerErrorMiddleware.genenrate_frame_html(frame: traceback.FrameSummary) -> str - added:
method ServerErrorMiddleware.generate_html(exc: Exception) -> str - added:
method ServerErrorMiddleware.generate_plain_text(exc: Exception) -> str
- added:
async method LifespanHandler.shutdown() -> None - added:
async method LifespanHandler.startup() -> None - added:
class LifespanHandler - added:
class LifespanMiddleware - added:
constructor LifespanHandler(app: ASGIApp, scope: Scope, startup_handlers: typing.List[typing.Callable], shutdown_handlers: typing.List[typing.Callable]) -> None - added:
constructor LifespanMiddleware(app: ASGIApp, startup_handlers: typing.List[typing.Callable]=ā¦, shutdown_handlers: typing.List[typing.Callable]=ā¦) - added:
method LifespanMiddleware.add_event_handler(event_type: str, func: typing.Callable) -> None - added:
method LifespanMiddleware.on_event(event_type: str) -> typing.Callable - added:
variable STATE_TRANSITION_ERROR
- changed:
constructor SessionMiddleware(app: ASGIApp, secret_key: str, session_cookie: str=ā¦, max_age: int=ā¦) -> None ā constructor SessionMiddleware(app: ASGIApp, secret_key: typing.Union[str, Secret], session_cookie: str=ā¦, max_age: int=ā¦, same_site: str=ā¦, https_only: bool=ā¦) -> None
- removed:
method Request.url_for(name: str, **path_params: typing.Any) -> str - removed:
property Request.cookies -> typing.Dict[str, str] - removed:
property Request.headers -> Headers - removed:
property Request.path_params -> dict - removed:
property Request.query_params -> QueryParams - removed:
property Request.session -> dict - removed:
property Request.url -> URL - changed:
async method Request.form() -> dict ā async method Request.form() -> FormData - changed:
class Request(Mapping) ā class Request(HTTPConnection) - changed:
constructor Request(scope: Scope, receive: Receive=ā¦) -> None ā constructor Request(scope: Scope, receive: Receive=ā¦) - added:
async method Request.is_disconnected() -> bool - added:
class HTTPConnection(Mapping) - added:
constructor HTTPConnection(scope: Scope, receive: Receive=ā¦) -> None - added:
method HTTPConnection.url_for(name: str, **path_params: typing.Any) -> str - added:
property HTTPConnection.auth -> typing.Any - added:
property HTTPConnection.client -> Address - added:
property HTTPConnection.cookies -> typing.Dict[str, str] - added:
property HTTPConnection.database -> typing.Any - added:
property HTTPConnection.headers -> Headers - added:
property HTTPConnection.path_params -> dict - added:
property HTTPConnection.query_params -> QueryParams - added:
property HTTPConnection.session -> dict - added:
property HTTPConnection.url -> URL - added:
property HTTPConnection.user -> typing.Any
- added:
class TemplateResponse(Response) - added:
constructor TemplateResponse(template: typing.Any, context: dict, status_code: int=ā¦, headers: dict=ā¦, media_type: str=ā¦, background: BackgroundTask=ā¦) - added:
field TemplateResponse.media_type
- removed:
method BaseRoute.compile_path(path: str) -> typing.Tuple[typing.Pattern, str, typing.Dict[str, Convertor]] - added:
class LifespanHandler - added:
constructor LifespanHandler(scope: Scope) -> None - added:
function compile_path(path: str) -> typing.Tuple[typing.Pattern, str, typing.Dict[str, Convertor]]
- removed:
function TestClient(app: ASGIApp, base_url: str=ā¦, raise_server_exceptions: bool=ā¦) -> _TestClient - added:
async method TestClient.lifespan() -> None - added:
async method TestClient.wait_shutdown() -> None - added:
async method TestClient.wait_startup() -> None - added:
class TestClient(requests.Session) - added:
constructor TestClient(app: ASGIApp, base_url: str=ā¦, raise_server_exceptions: bool=ā¦) -> None - added:
method TestClient.request(method: str, url: str, params: Params=ā¦, data: DataType=ā¦, headers: typing.MutableMapping[str, str]=ā¦, cookies: Cookies=ā¦, files: FileType=ā¦, auth: AuthType=ā¦, timeout: TimeOut=ā¦, allow_redirects: bool=ā¦, proxies: typing.MutableMapping[str, str]=ā¦, hooks: typing.Any=ā¦, stream: bool=ā¦, verify: typing.Union[bool, str]=ā¦, cert: typing.Union[str, typing.Tuple[str, str]]=ā¦, j⦠- added:
method TestClient.websocket_connect(url: str, subprotocols: typing.Sequence[str]=ā¦, **kwargs: typing.Any) -> typing.Any
- removed:
method WebSocket.url_for(name: str, **path_params: typing.Any) -> str - removed:
property WebSocket.headers -> Headers - removed:
property WebSocket.path_params -> dict - removed:
property WebSocket.query_params -> QueryParams - removed:
property WebSocket.url -> URL - changed:
async method WebSocket.accept(subprotocol: typing.List[str]=ā¦) -> None ā async method WebSocket.accept(subprotocol: str=ā¦) -> None - changed:
class WebSocket(Mapping) ā class WebSocket(HTTPConnection)