⬆️ Bump Starlette to <0.53.0#14695
Conversation
📝 Docs previewLast commit cd01810 at: https://992b0e89.fastapitiangolo.pages.dev |
|
Could we get this bumped to |
Sure. It looks like 0.52.0 should be compatible, and just adds a new feature: “In this release, State can be accessed using dictionary-style syntax for improved type safety (https://github.com/Kludex/starlette/pull/3036).” |
0.52.00.53.0
48e2a2d to
53ae0bd
Compare
|
Updated to allow Starlette 0.52. All tests still pass. |
|
Failing CI should be resolved by #14756 |
5880108 to
4d4a3c9
Compare
|
This pull request has a merge conflict that needs to be resolved. |
4d4a3c9 to
6d070b9
Compare
|
Will this allow using strict types for |
I have no idea. I suppose you must be talking about the changes in https://github.com/Kludex/starlette/releases/tag/0.52.0. |
It does not seem to work... I took the Starlette docs example, converted it to use FastAPI and forced an installation of from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from typing import TypedDict
import httpx
from fastapi import FastAPI, Request
from fastapi.responses import PlainTextResponse
class State(TypedDict):
http_client: httpx.AsyncClient
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncIterator[State]:
async with httpx.AsyncClient() as client:
yield {"http_client": client}
app = FastAPI(lifespan=lifespan)
@app.get("/")
async def homepage(request: Request[State]) -> PlainTextResponse:
client = request.state["http_client"]
reveal_type(client) # Revealed type is 'httpx.AsyncClient'
response = await client.get("https://www.example.com")
return PlainTextResponse(response.text)
if __name__ == "__main__":
import uvicorn
uvicorn.run(app=app) |
|
The above implies more changes are needed than just the bump. 😢 |
Thanks. Does this imply we need FastAPI changes to make it work, or further Starlette? |
|
FastAPI. |
Thank you, I'll be happy to contribute this change once this PR is merged, if needed. |
|
With #14756 in and CI all green, is there anything else blocking this PR @YuriiMotov? |
6d070b9 to
cd01810
Compare
|
Hi! Bumping this too, we need the updates to |
|
This pull request has a merge conflict that needs to be resolved. |
|
I guess this is now superseded by #14853 |
|
This was superseded by #14853, released in FastAPI 0.128.3 🎉 I fixed what is needed to support the latest Starlette version, and what is in git in the main branch in another PR. 🤓 |
@tiangolo Can I clarify if here you were referring to starlette 0.52.0+ |
Thank you! The broader version range will be quite helpful for downstream packaging. |
In Starlette 0.51, the warning stacklevel on
DeprecationWarningfor the wsgi module was increased. There is no impact to FastAPI; all tests still pass.