feat(examples): canonical minimal-DI example + README link - #7
Merged
Conversation
Rolls out the canonical examples/ + smoke-test + README Usage-example pattern piloted in modern-di-faststream to modern-di-aiogram.
CI floats ruff to a newer version than the repo's pinned dev dependency, and its markdown-code-fence formatting rules tightened; two pre-existing planning docs failed `ruff format --check` under it. Whitespace-only.
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.
Rolls out the canonical
examples/+ smoke-test + READMEUsage example:pattern piloted in
modern-di-faststream(
planning/changes/2026-07-24.01-canonical-example-onramp.md) tomodern-di-aiogram.examples/app.py:Settings(APP) +GreetingService(REQUEST) injectedby type into one
@dispatcher.message()handler via@inject+FromDI,wired by
setup_di. Boot lines (_run/__main__) are# pragma: no cover.tests/test_example.py: feeds a fakeUpdatethrough the real dispatcher(repo's own idiom —
botfixture,feed_update,tests/factories.make_message_update); onlyBot.__call__is a double(captures the outgoing
SendMessage.textinstead of a real Telegram call).DI resolution and
GreetingService.greetrun for real.README.md:Usage example: [examples/](./examples)line.pyproject.toml:CPY001added to the ruff ignore list.planning/changes/2026-07-25.01-canonical-example-onramp.md: Full-lanedesign record.
Test plan
just test-ci— 100% coverage, all tests passuvx ruff@0.16.0 check --no-fix .— cleanuvx ruff@0.16.0 format --check .— clean on all touched/new files(two pre-existing, untouched planning docs from 2026-07-10/11 fail this
newer ruff's markdown-code-fence reformatting; confirmed present on
mainbefore this branch, out of scope for this change)just check-planning— OKjust lint-ci— clean🤖 Generated with Claude Code