-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmkdocs.yml
More file actions
224 lines (218 loc) · 10.6 KB
/
Copy pathmkdocs.yml
File metadata and controls
224 lines (218 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
site_name: modern-di
site_url: https://modern-di.modern-python.org
repo_url: https://github.com/modern-python/modern-di
docs_dir: docs
edit_uri: edit/main/docs/
nav:
- Quick-Start: index.md
- Introduction:
- About DI: introduction/about-di.md
- Resolving: introduction/resolving.md
- Design decisions: introduction/design-decisions.md
- Comparison: introduction/comparison.md
- Performance: introduction/performance.md
- modern-di for FastAPI users: introduction/for-fastapi-users.md
- Providers:
- Scopes: providers/scopes.md
- Lifecycle: providers/lifecycle.md
- Factories: providers/factories.md
- Context: providers/context.md
- Container: providers/container.md
- Alias: providers/alias.md
- Errors and exceptions: providers/errors-and-exceptions.md
- Advanced / low-level API: providers/advanced-api.md
- Integrations:
- Web:
- aiohttp: integrations/aiohttp.md
- FastAPI: integrations/fastapi.md
- Flask: integrations/flask.md
- Litestar: integrations/litestar.md
- Starlette: integrations/starlette.md
- Tasks & events:
- arq: integrations/arq.md
- Celery: integrations/celery.md
- FastStream: integrations/faststream.md
- taskiq: integrations/taskiq.md
- Bots:
- aiogram: integrations/aiogram.md
- RPC:
- gRPC: integrations/grpc.md
- CLI:
- Typer: integrations/typer.md
- Testing:
- Pytest: integrations/pytest.md
- Writing an integration: integrations/writing-integrations.md
- Recipes:
- Async SQLAlchemy: recipes/sqlalchemy.md
- Async resources via lifespan: recipes/async-lifespan.md
- Multi-Group organization: recipes/multi-group.md
- Testing with overrides: recipes/testing-overrides.md
- Request-scoped engine selection: recipes/request-scoped-engine.md
- Good and bad practices: recipes/good-and-bad-practices.md
- Troubleshooting:
- Invalid Child Scope: troubleshooting/invalid-child-scope-error.md
- Max Scope Reached: troubleshooting/max-scope-reached-error.md
- Scope Not Initialized: troubleshooting/scope-not-initialized-error.md
- Scope Skipped: troubleshooting/scope-skipped-error.md
- Invalid Scope Type: troubleshooting/invalid-scope-type-error.md
- Container Closed: troubleshooting/container-closed-error.md
- Validation Failed: troubleshooting/validation-failed-error.md
- Missing Provider For Type: troubleshooting/missing-provider.md
- Alias Source Not Registered: troubleshooting/alias-source-not-registered-error.md
- Argument Resolution Error: troubleshooting/argument-resolution-error.md
- Circular Dependency: troubleshooting/circular-dependency.md
- Creator Call Error: troubleshooting/creator-call-error.md
- ContextProvider Has No Value: troubleshooting/context-not-set.md
- Duplicate Type Error: troubleshooting/duplicate-type-error.md
- Child Container Registration: troubleshooting/child-container-registration-error.md
- Group Scope Conflict: troubleshooting/group-scope-conflict-error.md
- Unknown Factory Kwarg: troubleshooting/unknown-factory-kwarg-error.md
- Unsupported Creator Parameter: troubleshooting/unsupported-creator-parameter-error.md
- Scope Chain Violation: troubleshooting/scope-chain.md
- Finalizer Error: troubleshooting/finalizer-error.md
- Async Finalizer In Sync Close: troubleshooting/async-finalizer-in-sync-close-error.md
- Group Instantiation Error: troubleshooting/group-instantiation-error.md
- Migration:
- To 1.x: migration/to-1.x.md
- To 2.x: migration/to-2.x.md
- To 3.x: migration/to-3.x.md
- From that-depends: migration/from-that-depends.md
- From dependency-injector: migration/from-dependency-injector.md
- Development:
- Contributing: dev/contributing.md
theme:
name: material
custom_dir: overrides
logo: assets/mark.svg
favicon: assets/favicon.svg
features:
- content.code.copy
- content.code.annotate
- content.action.edit
- content.action.view
- navigation.footer
- navigation.sections
- navigation.expand
- navigation.top
- navigation.instant
- header.autohide
- announce.dismiss
icon:
edit: material/pencil
view: material/eye
repo: fontawesome/brands/git-alt
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: custom
accent: custom
toggle:
icon: material/brightness-7
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: custom
accent: custom
toggle:
icon: material/brightness-4
name: Switch to system preference
validation:
omitted_files: warn
absolute_links: warn
unrecognized_links: warn
anchors: warn
markdown_extensions:
- toc:
permalink: true
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.tabbed:
alternate_style: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- admonition
- pymdownx.details
- def_list
- codehilite:
use_pygments: true
- attr_list
- md_in_html
extra_css:
- css/code.css
- css/brand.css
plugins:
- llmstxt:
full_output: llms-full.txt
markdown_description: "Powerful dependency-injection framework with IoC container and scopes."
sections:
Quickstart:
- index.md: How to install and a minimal container example
Introduction:
- introduction/about-di.md: What dependency injection is and the problem it solves
- introduction/resolving.md: Resolving dependencies by type or by provider reference
- introduction/design-decisions.md: The deliberate API choices behind modern-di
- introduction/comparison.md: How modern-di compares to other DI approaches, including that-depends
- introduction/performance.md: Comparative benchmarks vs other DI frameworks, and how to reproduce them
- introduction/for-fastapi-users.md: Translating FastAPI's Depends idioms to modern-di
Providers:
- providers/scopes.md: The five built-in scopes and the resolution rule
- providers/lifecycle.md: How instances are created, cached, and cleaned up
- providers/factories.md: Regular vs cached Factory providers
- providers/context.md: Injecting runtime context values with ContextProvider
- providers/container.md: The auto-registered provider that resolves to the Container itself
- providers/alias.md: Binding one type to an already-registered provider
- providers/errors-and-exceptions.md: The ModernDIError exception hierarchy
- providers/advanced-api.md: Low-level extension points for library authors
Integrations:
# Bulk-include every integration page so a new one needs no edit here;
# the two lines below re-list the pages whose description adds info
# beyond the nav label (a glob yields an empty description).
- integrations/*.md
- integrations/pytest.md: Usage with pytest, with and without modern-di-pytest
- integrations/writing-integrations.md: Specification for building a new framework integration
Recipes:
- recipes/sqlalchemy.md: Wiring an async SQLAlchemy engine, session, and repositories
- recipes/async-lifespan.md: Constructing async resources via the framework lifespan
- recipes/multi-group.md: Organizing a large container with multiple Groups
- recipes/testing-overrides.md: Swapping dependencies in tests with overrides
- recipes/request-scoped-engine.md: Routing requests to different engines by scope
- recipes/good-and-bad-practices.md: Common DI footguns and how modern-di catches them
Troubleshooting:
- troubleshooting/invalid-child-scope-error.md: Diagnosing InvalidChildScopeError
- troubleshooting/max-scope-reached-error.md: Diagnosing MaxScopeReachedError
- troubleshooting/scope-not-initialized-error.md: Diagnosing ScopeNotInitializedError
- troubleshooting/scope-skipped-error.md: Diagnosing ScopeSkippedError
- troubleshooting/invalid-scope-type-error.md: Diagnosing InvalidScopeTypeError
- troubleshooting/container-closed-error.md: Diagnosing ContainerClosedError
- troubleshooting/validation-failed-error.md: Diagnosing ValidationFailedError
- troubleshooting/missing-provider.md: Diagnosing missing provider registration errors
- troubleshooting/alias-source-not-registered-error.md: Diagnosing AliasSourceNotRegisteredError
- troubleshooting/argument-resolution-error.md: Diagnosing ArgumentResolutionError
- troubleshooting/circular-dependency.md: Diagnosing circular dependency errors
- troubleshooting/creator-call-error.md: Diagnosing CreatorCallError
- troubleshooting/context-not-set.md: Diagnosing ContextProvider-has-no-value errors
- troubleshooting/duplicate-type-error.md: Diagnosing duplicate bound_type registration errors
- troubleshooting/child-container-registration-error.md: Diagnosing ChildContainerRegistrationError
- troubleshooting/group-scope-conflict-error.md: Diagnosing GroupScopeConflictError
- troubleshooting/unknown-factory-kwarg-error.md: Diagnosing UnknownFactoryKwargError
- troubleshooting/unsupported-creator-parameter-error.md: Diagnosing UnsupportedCreatorParameterError
- troubleshooting/scope-chain.md: Diagnosing scope chain violation errors
- troubleshooting/finalizer-error.md: Diagnosing FinalizerError
- troubleshooting/async-finalizer-in-sync-close-error.md: Diagnosing AsyncFinalizerInSyncCloseError
- troubleshooting/group-instantiation-error.md: Diagnosing GroupInstantiationError
Migration:
- migration/to-1.x.md: Migrating from modern-di 0.x to 1.x
- migration/to-2.x.md: Migrating from modern-di 1.x to 2.x
- migration/to-3.x.md: Migrating from modern-di 2.x to 3.x
- migration/from-that-depends.md: Migrating an existing that-depends codebase to modern-di
- migration/from-dependency-injector.md: Migrating an existing dependency-injector codebase to modern-di
Development:
- dev/contributing.md: Contributing guide for local setup and workflow
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/modern-python/modern-di
name: GitHub