feat(examples): canonical minimal-DI example + README link - #7
Merged
Conversation
Rolls the faststream-piloted canonical-example pattern into modern-di-arq: examples/app.py (Settings + GreetingService via @inject/FromDI, wired by setup_di), an in-memory smoke test covering it to 100% (no Redis, using the repo's own ctx-seeding idiom), and the README Usage example: link. Also reformats two pre-existing files (README.md's inline snippet, an old planning change) that ruff 0.16 newly flags for Markdown code-fence formatting, since the lint group's unpinned ruff would otherwise break CI on the next uv lock --upgrade regardless of this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/app.py(+examples/__init__.py): the smallest arq setup —Settings(APP scope) +GreetingService(REQUEST scope) injected by type into one@inject/FromDItask, wired viasetup_di.tests/test_example.py: an in-memory smoke test (no Redis) that mirrors the repo's own_wrap_job_start/ctx-seeding idiom to call the wrapped task directly and assert the real greeting.Usage example: [examples/](./examples)to README, underFull guide.CPY001to the ruff ignore list (no per-file copyright header), matching the faststream pilot.planning/changes/2026-07-25.01-canonical-example-onramp.md(Full-lane design bundle).ruffis unpinned in thelintdependency group, so this would otherwise break CI on the nextuv lock --upgradeindependent of this change.Test plan
just test-ci— 100% coverage, 20 passed (real Redis available locally;examples/app.pyfully covered by the new smoke test).uvx ruff@0.16.0 check --no-fix .— clean.uvx ruff@0.16.0 format --check .— clean.just check-planning/just lint-ci— clean.🤖 Generated with Claude Code