Skip to content

feat(examples): canonical minimal-DI example + README link - #7

Merged
lesnik512 merged 1 commit into
mainfrom
canonical-example-onramp
Jul 25, 2026
Merged

feat(examples): canonical minimal-DI example + README link#7
lesnik512 merged 1 commit into
mainfrom
canonical-example-onramp

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

  • Adds examples/app.py (+ examples/__init__.py): the smallest arq setup — Settings (APP scope) + GreetingService (REQUEST scope) injected by type into one @inject/FromDI task, wired via setup_di.
  • Adds 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.
  • Adds Usage example: [examples/](./examples) to README, under Full guide.
  • Adds CPY001 to the ruff ignore list (no per-file copyright header), matching the faststream pilot.
  • Adds planning/changes/2026-07-25.01-canonical-example-onramp.md (Full-lane design bundle).
  • Incidental: reformats two pre-existing files (README's inline snippet, an old planning change) that ruff 0.16 newly flags for Markdown code-fence formatting — ruff is unpinned in the lint dependency group, so this would otherwise break CI on the next uv lock --upgrade independent of this change.

Test plan

  • just test-ci — 100% coverage, 20 passed (real Redis available locally; examples/app.py fully 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

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.
@lesnik512
lesnik512 merged commit f96c6ac into main Jul 25, 2026
6 checks passed
@lesnik512
lesnik512 deleted the canonical-example-onramp branch July 25, 2026 04:57
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.

1 participant