pypi async-typer 0.2.1

4 hours ago

Bug fixes

Lifecycle handlers are now command-scoped and fire exactly once per invocation.

In 0.2.0, command() and callback() each wrapped their callable with its own lifecycle asyncio.Runner. When an app had both an async callback and an async command, the startup/shutdown handlers ran twice — once around the callback and once around the command, on two different event loops. Non-idempotent startup/shutdown side effects (counters, locks, notifications, migrations) would double-execute.

Lifecycle is now scoped to the command body — matching the once-per-invocation contract of the Starlette/FastAPI add_event_handler API that this mirrors. Async callbacks run their coroutine without firing lifecycle handlers.

Resolves the known limitation noted in the 0.2.0 release.

Full changelog: 0.2.0...0.2.1

Don't miss a new async-typer release

NewReleases is sending notifications on new releases.