Skip to content

fix: remove startup/shutdown calls incompatible with Starlette 1.0#27

Merged
s3rius merged 3 commits intotaskiq-python:masterfrom
megalaren:fix-starlette-1.0-compat
Apr 18, 2026
Merged

fix: remove startup/shutdown calls incompatible with Starlette 1.0#27
s3rius merged 3 commits intotaskiq-python:masterfrom
megalaren:fix-starlette-1.0-compat

Conversation

@megalaren
Copy link
Copy Markdown

Starlette 1.0 removed Router.startup() and Router.shutdown() methods.
The lifespan context (aenter/aexit) already handles the application lifecycle correctly.

@s3rius
Copy link
Copy Markdown
Member

s3rius commented Apr 1, 2026

Can you bump minimum fastapi version to be the one where they deprecated the router.startup?

@megalaren
Copy link
Copy Markdown
Author

This is actually a Starlette change, not FastAPI - those methods are missing from Starlette's router, which FastAPI inherits. So the constraint should be on the Starlette version, not FastAPI.

@vahidzhe
Copy link
Copy Markdown

Hi @s3rius

Just wanted to add a +1 on this PR — I'm also hitting the AttributeError: 'APIRouter' object has no attribute 'startup' issue after upgrading to FastAPI 0.128.3+ / Starlette 0.40.

The fix in this PR unblocks the problem. As a temporary workaround I'm currently pinning fastapi<0.128.3, but that's not sustainable long-term.

Is there anything blocking the merge? Happy to help test or add anything that would make this easier to land. 🙏

@s3rius s3rius merged commit c766da5 into taskiq-python:master Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants