Comparing dalito:develop...starfederation:develop · dalito/datastar-python
Commits on Apr 17, 2026
-
align datastar_response behavior with docs (tests, fixes, examples) (s…
…tarfederation#27) * Add decorator matrix and integration tests * Normalize decorator return to DatastarResponse * Document decorator preserving sync handlers * Refine decorator to preserve sync/async semantics * respond to reviewer feedback: - remove unnecessary partial function check - exchange deco-time async generator vs coroutine check for runtime - make analogous changes for each supported framework - update test docstring to reflect implementation * respond to review: restore Quart context, allow Django async generators, trim tests - quart: restore copy_current_request_context in the coroutine branch (dropped in 90d9d41 without justification; reviewer flagged regression risk) - django: drop NotImplementedError for async generators; unify coroutine + async-gen into a single async wrapper. Django's StreamingHttpResponse supports async iteration under ASGI, so this restores prior permissive behavior - matrix test: unskip the Django async_generator case (now passes) - tests: remove per-framework live-server integration tests (fastapi, fasthtml, litestar, starlette); keep test_decorator_matrix.py for cross-framework contract coverage and test_sync_handler_runs_off_event_loop as the regression guard for the original bug Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix pre-commit lint failures - add tests/** to ruff per-file-ignores for ANN, PLC0415, PLR2004 (mirrors existing examples/ treatment; these rules are noisy for test fixtures, conditional framework imports, and threshold values) - remove leftover unused Union import in sanic.py (rebase artifact) - apply ruff --fix and ruff format to test files - add `lint` target to Makefile Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>