wireup 2.8.0__tar.gz → 2.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wireup-2.8.0 → wireup-2.10.0}/PKG-INFO +82 -157
- {wireup-2.8.0 → wireup-2.10.0}/docs/mkdocs.yml +9 -4
- wireup-2.10.0/docs/overrides/main.html +24 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/benchmarks.md +10 -8
- wireup-2.10.0/docs/pages/class/fastapi_integration.md +8 -0
- wireup-2.10.0/docs/pages/class/starlette_integration.md +8 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/conditional_registration.md +6 -36
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/container.md +50 -4
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/factories.md +7 -76
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/function_injection.md +57 -3
- wireup-2.10.0/docs/pages/generic_dependencies.md +34 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/index.md +5 -44
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/injectables.md +100 -7
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/aiohttp/index.md +7 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/click/index.md +7 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/django/app_injection.md +34 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/django/index.md +35 -11
- wireup-2.8.0/docs/pages/integrations/django/request_lifecycle_patterns.md → wireup-2.10.0/docs/pages/integrations/django/request_time_injection.md +8 -9
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastapi/background_tasks.md +1 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastapi/index.md +13 -6
- wireup-2.8.0/docs/pages/integrations/fastapi/request_lifecycle_patterns.md → wireup-2.10.0/docs/pages/integrations/fastapi/request_time_injection.md +36 -34
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastapi/testing.md +5 -5
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastapi/troubleshooting.md +4 -4
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/flask/index.md +7 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/starlette/background_tasks.md +1 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/typer/index.md +7 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/interfaces.md +3 -1
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/lifetimes_and_scopes.md +69 -15
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/migrate_to_wireup/dependency_injector.md +1 -1
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/migrate_to_wireup/fastapi_depends.md +42 -31
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/migrate_to_wireup/index.md +1 -1
- wireup-2.10.0/docs/pages/packaging_injectables.md +108 -0
- wireup-2.10.0/docs/pages/reusable_bundles.md +74 -0
- wireup-2.10.0/docs/pages/stylesheets/extra.css +32 -0
- wireup-2.10.0/docs/pages/testing.md +259 -0
- wireup-2.10.0/docs/pages/what_wireup_validates.md +352 -0
- wireup-2.10.0/pet_store_demo_app/README.md +20 -0
- wireup-2.10.0/pet_store_demo_app/__init__.py +1 -0
- wireup-2.10.0/pet_store_demo_app/cbr.py +29 -0
- wireup-2.10.0/pet_store_demo_app/factories.py +22 -0
- wireup-2.10.0/pet_store_demo_app/fastapi_services.py +29 -0
- wireup-2.10.0/pet_store_demo_app/flask_main.py +84 -0
- wireup-2.10.0/pet_store_demo_app/main.py +89 -0
- wireup-2.10.0/pet_store_demo_app/services/__init__.py +17 -0
- wireup-2.10.0/pet_store_demo_app/services/adoption.py +35 -0
- wireup-2.10.0/pet_store_demo_app/services/audit.py +21 -0
- wireup-2.10.0/pet_store_demo_app/services/infra.py +27 -0
- wireup-2.10.0/pet_store_demo_app/services/owners.py +28 -0
- wireup-2.10.0/pet_store_demo_app/services/pets.py +41 -0
- wireup-2.10.0/pet_store_demo_app/services/session.py +23 -0
- {wireup-2.8.0 → wireup-2.10.0}/pyproject.toml +1 -1
- wireup-2.10.0/readme.md +309 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/aiohttp/test_aiohttp_integration.py +27 -1
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/test_django_integration.py +43 -1
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastapi/test_fastapi_integration.py +108 -1
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/starlette/test_starlette_integration.py +111 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_container_core.py +54 -3
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_container_scope.py +35 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_inject_from_container.py +26 -0
- wireup-2.10.0/test/unit/test_instance.py +78 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_service_registry.py +24 -9
- {wireup-2.8.0 → wireup-2.10.0}/tox.ini +7 -5
- {wireup-2.8.0 → wireup-2.10.0}/uv.lock +1 -1
- {wireup-2.8.0 → wireup-2.10.0}/wireup/__init__.py +6 -2
- {wireup-2.8.0 → wireup-2.10.0}/wireup/_decorators.py +19 -13
- wireup-2.10.0/wireup/_instance.py +38 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/aiohttp.py +11 -14
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/django/apps.py +15 -28
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/starlette.py +25 -26
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/container/__init__.py +21 -2
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/container/async_container.py +10 -4
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/container/sync_container.py +5 -2
- wireup-2.10.0/wireup/ioc/dependency_introspection.py +41 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/factory_compiler.py +7 -5
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/registry.py +17 -150
- wireup-2.10.0/wireup/ioc/registry_validation.py +146 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/util.py +9 -2
- wireup-2.10.0/z_docs/.obsidian/app.json +1 -0
- wireup-2.10.0/z_docs/.obsidian/appearance.json +3 -0
- wireup-2.10.0/z_docs/.obsidian/core-plugins.json +33 -0
- wireup-2.10.0/z_docs/.obsidian/workspace.json +215 -0
- wireup-2.10.0/z_docs/drafts/codex_djangoforum.md +79 -0
- wireup-2.10.0/z_docs/drafts/codex_fastmcp_post.md +66 -0
- wireup-2.10.0/z_docs/drafts/codex_r_fastapi_post copy.md +84 -0
- wireup-2.10.0/z_docs/drafts/codex_r_fastapi_post.md +81 -0
- wireup-2.10.0/z_docs/drafts/coxed_fastapi_discussion.md +90 -0
- {wireup-2.8.0/z_docs → wireup-2.10.0/z_docs/drafts}/coxed_fastmcp_post.md +1 -32
- wireup-2.10.0/z_docs/drafts/dodona_march_en.md +904 -0
- wireup-2.10.0/z_docs/drafts/hrt.md +364 -0
- wireup-2.10.0/z_docs/drafts/open_generics.md +363 -0
- wireup-2.10.0/z_docs/ideas/collection_injection_docs_draft.md +276 -0
- wireup-2.10.0/z_docs/ideas/config_and_qualified_type_sugar.md +98 -0
- wireup-2.10.0/z_docs/ideas/docs_map_for_default_llm_choice.md +323 -0
- wireup-2.10.0/z_docs/ideas/lazy.md +513 -0
- wireup-2.10.0/z_docs/ideas/mapping_collection_injection_api.md +469 -0
- wireup-2.10.0/z_docs/ideas/post_aggregates_followups.md +167 -0
- wireup-2.10.0/z_docs/ideas/readme update - advanced section.md +12 -0
- wireup-2.10.0/z_docs/ideas/scoped_override.md +304 -0
- wireup-2.10.0/z_docs/ideas/tagged_collection_injection_sketch.md +527 -0
- wireup-2.10.0/z_docs/ideas/tmp_sequence_filter_demo.py +80 -0
- wireup-2.10.0/z_docs/ideas/wrap_with_dependencies.md +78 -0
- wireup-2.10.0/z_docs/style/docs_voice.md +16 -0
- wireup-2.10.0/z_prep/z_test_hrt17.py +17 -0
- wireup-2.10.0/z_prep/z_test_hrt18.py +48 -0
- wireup-2.10.0/z_sugar.py +28 -0
- wireup-2.10.0/z_test.py +36 -0
- wireup-2.10.0/z_test_2.py +19 -0
- wireup-2.10.0/z_test_3.py +24 -0
- wireup-2.10.0/z_test_dict.py +9 -0
- wireup-2.10.0/z_test_instance.py +12 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_misc.py +12 -0
- wireup-2.10.0/z_test_provider_style.py +3 -0
- wireup-2.10.0/z_test_services/__init__.py +0 -0
- wireup-2.10.0/z_z.py +70 -0
- wireup-2.10.0/z_zz.py +105 -0
- wireup-2.8.0/.agent/rules.md +0 -3
- wireup-2.8.0/docs/overrides/main.html +0 -17
- wireup-2.8.0/docs/pages/class/fastapi_integration.md +0 -3
- wireup-2.8.0/docs/pages/class/starlette_integration.md +0 -3
- wireup-2.8.0/docs/pages/stylesheets/extra.css +0 -83
- wireup-2.8.0/docs/pages/testing.md +0 -220
- wireup-2.8.0/readme.md +0 -384
- wireup-2.8.0/z_docs/2.8.0.md +0 -28
- wireup-2.8.0/z_docs/coxed_django_forum_post.md +0 -114
- wireup-2.8.0/z_docs/coxed_fastapi_discussion.md +0 -119
- wireup-2.8.0/z_docs/coxed_python_benchmark_showdown.md +0 -38
- wireup-2.8.0/z_docs/coxed_r_fastapi_post.md +0 -128
- wireup-2.8.0/z_docs/ideas/coxed_fastapi_reddit.md +0 -55
- wireup-2.8.0/z_docs/ideas/dependency_injector_post.md +0 -27
- wireup-2.8.0/z_docs/ideas/z_test_changelog.md +0 -25
- wireup-2.8.0/z_docs/ideas/z_test_diwire_wireup_report.md +0 -1305
- wireup-2.8.0/z_docs/ideas/z_test_factory_compiler_perf.md +0 -31
- wireup-2.8.0/z_docs/ideas/z_test_glm_testing_report.md +0 -479
- wireup-2.8.0/z_docs/ideas/z_test_new_integrations.md +0 -134
- wireup-2.8.0/z_test_2.8.0_release.md +0 -97
- {wireup-2.8.0/.agent → wireup-2.10.0/.agents}/workflows/context.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/.gitignore +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/10044845188665810066 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/10294724371649670728 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/1076323475707195139 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/11070404547826992651 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/11124823139456244859 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/11293014782143221354 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/1226111022864589093 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/12549328558144052424 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/1271758769353586558 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/12733979256433392731 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/12752882211929243556 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/12783426531917578909 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/12830345886006928062 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/13014544647268190247 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/13083424730640715152 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/13128933095426148813 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/13370773888390464336 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/13403801197489695949 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/1361555227596880095 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/13775377501054353309 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/1439640565749963662 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/14761872988004119841 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/14837314323412076685 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/15018906666218230475 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/15137346072215138130 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/15746470211891335948 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/16124785681570184387 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/16306461914818170209 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/17346873189989222451 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/17539328537605741444 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/1756490492350570913 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/17695288524157522424 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/17993352065017356676 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/2491296543125450213 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/2511243215163562241 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/2989687286403812976 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/3004183706503532835 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/3121150246064866450 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/3124270596782374079 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/3476900567878811119 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/3702806183923662406 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/4201971366852234974 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/4248594428038296655 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/4328746867122106743 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/453810864507090243 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/4607165423255654887 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/4655087458686603143 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/4911927025649090134 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/5545364815676479752 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/5582803025959560496 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/6446587083349335436 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/7197171008315212702 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/7815757281852325210 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/7940362391983581688 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/8465230536178924220 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/8499329960173449201 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/8504618348287803373 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/8761805547931915049 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/918853441261096549 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/9231702844672586930 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/9252445419859529063 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/9597896872206851048 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/9860729219353091761 +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.cache/9961436229075698645 +0 -0
- /wireup-2.8.0/benchmarks/wireup_benchmarks/__init__.py → /wireup-2.10.0/.codex +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.github/contributing.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.github/workflows/run_all.yml +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.github/workflows/run_integration_tests.yml +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.gitignore +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.vscode/launch.json +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/.vscode/settings.json +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/Makefile +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/bench_runner.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/benchmark_meta.json +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/benchmark_results.csv +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/benchmark_run_metrics.csv +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/generate_charts.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/generate_tables.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/generate_versions.py +0 -0
- {wireup-2.8.0/test → wireup-2.10.0/benchmarks/wireup_benchmarks}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/aioinject_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/app.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/dependency_injector_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/dishka_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/diwire_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/fastapi_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/globals_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/injector_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/lagom_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/services.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/svcs_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/that_depends_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/wireup_cbr_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/benchmarks/wireup_benchmarks/wireup_setup.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/.cache/.gitignore +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/aiohttp_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/asgi_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/celery_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/click_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/config_store.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/django_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/fastmcp_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/flask_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/override_manager.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/typer_integration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/class/wireup.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/configuration.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/getting_started.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/img/benchmarks_scoped_dark.svg +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/img/benchmarks_scoped_light.svg +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/img/benchmarks_singleton_dark.svg +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/img/benchmarks_singleton_light.svg +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/aiohttp/class_based_handlers.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/asgi/generic_asgi.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/celery/index.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/django/setup.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/django/testing.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/django/troubleshooting.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/django/view_injection.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastapi/class_based_handlers.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastapi/context_in_services.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastapi/inject_in_routes.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/fastmcp/index.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/index.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/starlette/index.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/integrations/strawberry/index.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/resources.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/upgrading.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/docs/pages/versioning.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/license.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/profile_tests.py +0 -0
- {wireup-2.8.0/test/integration → wireup-2.10.0/test}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/conftest.py +0 -0
- {wireup-2.8.0/test/integration/aiohttp → wireup-2.10.0/test/integration}/__init__.py +0 -0
- {wireup-2.8.0/test/integration/click → wireup-2.10.0/test/integration/aiohttp}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/aiohttp/handler.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/aiohttp/routes.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/aiohttp/services.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/asgi/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/asgi/test_asgi_integration.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/celery/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/celery/test_celery_integration.py +0 -0
- {wireup-2.8.0/test/integration/django → wireup-2.10.0/test/integration/click}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/click/test_click_integration.py +0 -0
- {wireup-2.8.0/test/integration/django/apps → wireup-2.10.0/test/integration/django}/__init__.py +0 -0
- {wireup-2.8.0/test/integration/django/apps/app_1 → wireup-2.10.0/test/integration/django/apps}/__init__.py +0 -0
- {wireup-2.8.0/test/integration/django/apps/app_2 → wireup-2.10.0/test/integration/django/apps/app_1}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_1/app.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_1/management/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_1/management/commands/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_1/management/commands/wireup_greet.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_1/urls.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_1/views.py +0 -0
- {wireup-2.8.0/test/integration/django/apps/drf_app → wireup-2.10.0/test/integration/django/apps/app_2}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_2/app.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_2/urls.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/app_2/views.py +0 -0
- {wireup-2.8.0/test/integration/django/apps/ninja_app → wireup-2.10.0/test/integration/django/apps/drf_app}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/drf_app/app.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/drf_app/urls.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/drf_app/views.py +0 -0
- {wireup-2.8.0/test/integration/django/factory → wireup-2.10.0/test/integration/django/apps/ninja_app}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/ninja_app/app.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/ninja_app/urls.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/apps/ninja_app/views.py +0 -0
- {wireup-2.8.0/test/integration/django/injectable → wireup-2.10.0/test/integration/django/factory}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/factory/factories.py +0 -0
- {wireup-2.8.0/test/integration/fastapi → wireup-2.10.0/test/integration/django/injectable}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/injectable/current_request_service.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/injectable/random_service.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/templates/bar.html +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/templates/foo.html +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/django/view.py +0 -0
- {wireup-2.8.0/test/integration/flask → wireup-2.10.0/test/integration/fastapi}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastapi/cbr.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastapi/router.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastapi/services.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastapi/test_fastapi_codegen_snapshots.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastapi/wireup_route.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastmcp/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/fastmcp/test_fastmcp_standalone_usage.py +0 -0
- {wireup-2.8.0/test/integration/flask/services → wireup-2.10.0/test/integration/flask}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/flask/bp.py +0 -0
- {wireup-2.8.0/test/integration/starlette → wireup-2.10.0/test/integration/flask/services}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/flask/services/factories.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/flask/services/is_test_service.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/flask/test_flask_integration.py +0 -0
- {wireup-2.8.0/test/shared → wireup-2.10.0/test/integration/starlette}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/strawberry/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/strawberry/test_strawberry_django_usage.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/strawberry/test_strawberry_fastapi_usage.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/strawberry/test_strawberry_starlette_usage.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/typer/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/integration/typer/test_typer_integration.py +0 -0
- {wireup-2.8.0/test/shared/shared_services → wireup-2.10.0/test/shared}/__init__.py +0 -0
- {wireup-2.8.0/test/unit → wireup-2.10.0/test/shared/shared_services}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/shared/shared_services/greeter.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/shared/shared_services/rand.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/shared/shared_services/scoped.py +0 -0
- {wireup-2.8.0/test/unit/services/no_annotations/random → wireup-2.10.0/test/unit}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/service_refs/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/abstract_multiple_bases.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/async_reg.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/inheritance_test/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/inheritance_test/base.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/no_annotations/__init__.py +0 -0
- {wireup-2.8.0/test/unit/services/with_annotations → wireup-2.10.0/test/unit/services/no_annotations/random}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/no_annotations/random/random_service.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/no_annotations/random/truly_random_service.py +0 -0
- {wireup-2.8.0/wireup/integration → wireup-2.10.0/test/unit/services/with_annotations}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/with_annotations/env/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/services/with_annotations/services.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_as_type.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_compiler_code_generation.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_concurrency.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_container_creation.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_container_generator_factory.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_container_override.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_eval_type.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_exit_stack.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_inject_from_container_optional_types.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_inject_from_container_stringified_types.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_module_loading.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_optional_type.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_parameter.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_pos_only_validation.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_service_deprecation.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_signature_hiding.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_type_analysis.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/test_util.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/test/unit/util.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/_annotations.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/_discovery.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/_wrapper_compiler.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/codegen.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/errors.py +0 -0
- {wireup-2.8.0/wireup/ioc → wireup-2.10.0/wireup/integration}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/asgi.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/celery.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/click.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/django/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/django/decorators.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/fastapi.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/fastmcp.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/flask.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/integration/typer.py +0 -0
- {wireup-2.8.0/z_prep → wireup-2.10.0/wireup/ioc}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/_exit_stack.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/configuration.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/container/base_container.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/container/lock_registry.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/override_manager.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/type_analysis.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/ioc/types.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/py.typed +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/wireup/util.py +0 -0
- {wireup-2.8.0/z_docs → wireup-2.10.0/z_docs/drafts}/coxed_strawberry_discussion.md +0 -0
- /wireup-2.8.0/z_docs/ideas/z_test_wireup_nested_scopes.md → /wireup-2.10.0/z_docs/ideas/nested scopes.md +0 -0
- /wireup-2.8.0/z_docs/ideas/z_test_transactional.md → /wireup-2.10.0/z_docs/ideas/transactional.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_docs/ideas/wireup_provided.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_docs/ideas/z_test_community_engagement.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_docs/ideas/z_test_dependency_injector.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_docs/ideas/z_test_seo_plan.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_docs/ideas/z_test_wireup_seo_plan_2026.md +0 -0
- {wireup-2.8.0/z_test_services → wireup-2.10.0/z_prep}/__init__.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/js_stack.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_cit_code1.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_cit_code2.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_cit_palindrome.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_citadel_oa1.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt10.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt11.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt12.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt13.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt14.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt15.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt16.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt2.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt3.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt4.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt5.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt6.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt7.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt8.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_hrt9.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_js_code1.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_js_code2.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_prep/z_test_py.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_benchmark.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_bug.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_fastapi.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_get_typeform.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_hash.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_inject_from_container.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_leetcode_arrays_lists.md +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_reusable.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_services/bar.py +0 -0
- {wireup-2.8.0 → wireup-2.10.0}/z_test_services/foo.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wireup
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.10.0
|
|
4
4
|
Summary: Python Dependency Injection Library
|
|
5
5
|
Project-URL: Homepage, https://github.com/maldoinc/wireup
|
|
6
6
|
Project-URL: Repository, https://github.com/maldoinc/wireup
|
|
@@ -47,39 +47,68 @@ Type-driven dependency injection for Python. Wireup is battle-tested in producti
|
|
|
47
47
|
[](https://pypi.org/project/wireup/)
|
|
48
48
|
[](https://pypi.org/project/wireup/)
|
|
49
49
|
<br />
|
|
50
|
-
[](https://maldoinc.github.io/wireup)
|
|
51
|
-
[](https://maldoinc.github.io/wireup)
|
|
52
50
|
|
|
53
51
|
</div>
|
|
54
52
|
|
|
53
|
+
<p align="center">
|
|
54
|
+
<a href="#quick-start"><strong>Quick Start</strong></a> ·
|
|
55
|
+
<a href="https://maldoinc.github.io/wireup"><strong>Docs</strong></a> ·
|
|
56
|
+
<a href="https://maldoinc.github.io/wireup/latest/benchmarks/"><strong>Benchmarks</strong></a> ·
|
|
57
|
+
<a href="https://maldoinc.github.io/wireup/latest/migrate_to_wireup/"><strong>Migrate to Wireup</strong></a>
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
## Why Wireup?
|
|
61
|
+
|
|
62
|
+
<table>
|
|
63
|
+
<tr>
|
|
64
|
+
<td align="center" valign="top" width="33%">
|
|
65
|
+
<h3>🔁 Define Once, Use Anywhere</h3>
|
|
66
|
+
Reuse the same application code in APIs, CLIs, workers, and scripts without rewriting your wiring.
|
|
67
|
+
</td>
|
|
68
|
+
<td align="center" valign="top" width="33%">
|
|
69
|
+
<h3>✅ Correct by Default</h3>
|
|
70
|
+
If the container starts, your dependency graph is valid. Wireup checks for missing or misconfigured dependencies to avoid surprises at runtime. See <a href="https://maldoinc.github.io/wireup/latest/what_wireup_validates/">What Wireup Validates</a>
|
|
71
|
+
</td>
|
|
72
|
+
<td align="center" valign="top" width="33%">
|
|
73
|
+
<h3>🌐 Framework-Ready</h3>
|
|
74
|
+
Native integrations for <strong>FastAPI</strong>, <strong>Django</strong>, <strong>Flask</strong>, <strong>Starlette</strong>, <strong>Celery</strong>, <strong>Click</strong>, <strong>Typer</strong>, and more.
|
|
75
|
+
</td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td align="center" valign="top">
|
|
79
|
+
<h3>⚡ Zero-Overhead Handlers</h3>
|
|
80
|
+
Resolve singleton constructor dependencies once at startup in <a href="https://maldoinc.github.io/wireup/latest/integrations/fastapi/class_based_handlers/">FastAPI</a> and <a href="https://maldoinc.github.io/wireup/latest/integrations/aiohttp/class_based_handlers/">AIOHTTP</a> class-based handlers, not per request.
|
|
81
|
+
</td>
|
|
82
|
+
<td align="center" valign="top">
|
|
83
|
+
<h3>🧩 Advanced Wiring</h3>
|
|
84
|
+
Go beyond simple constructor injection with
|
|
85
|
+
<a href="https://maldoinc.github.io/wireup/latest/reusable_bundles/">reusable bundles</a>,
|
|
86
|
+
<a href="https://maldoinc.github.io/wireup/latest/lifetimes_and_scopes/">explicit scope context sharing</a>, and
|
|
87
|
+
more using plain Python.
|
|
88
|
+
</td>
|
|
89
|
+
<td align="center" valign="top">
|
|
90
|
+
<h3>🧪 Easy to test</h3>
|
|
91
|
+
Override dependencies with context managers, keep tests isolated, and restore the original graph automatically.
|
|
92
|
+
</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</table>
|
|
95
|
+
|
|
96
|
+
## Benchmarks
|
|
55
97
|
|
|
56
98
|
<p align="center">
|
|
57
99
|
<picture>
|
|
58
100
|
<source media="(prefers-color-scheme: dark)" srcset="docs/pages/img/benchmarks_scoped_dark.svg">
|
|
59
101
|
<source media="(prefers-color-scheme: light)" srcset="docs/pages/img/benchmarks_scoped_light.svg">
|
|
60
|
-
<img alt="Scoped Dependency Injection Performance" src="docs/pages/img/benchmarks_scoped_light.svg">
|
|
102
|
+
<img alt="Scoped Dependency Injection Performance" src="docs/pages/img/benchmarks_scoped_light.svg" height="300">
|
|
61
103
|
</picture>
|
|
62
104
|
</p>
|
|
63
105
|
|
|
64
106
|
<p align="center">
|
|
65
|
-
<i>
|
|
66
|
-
(Requests per second, higher is better. Manual Wiring represents the upper bound.)
|
|
107
|
+
<i>Dense dependency graph resolved per request in FastAPI + Uvicorn<br>
|
|
108
|
+
(Requests per second, higher is better. Manual Wiring represents the upper bound.)<br>
|
|
67
109
|
Full methodology and reproducibility: <a href="https://maldoinc.github.io/wireup/latest/benchmarks/">benchmarks</a>.</i>
|
|
68
110
|
</p>
|
|
69
111
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
> [!TIP]
|
|
73
|
-
> **New**: Inject singleton dependencies in FastAPI with zero overhead using [Class-Based Handlers](https://maldoinc.github.io/wireup/latest/integrations/fastapi/class_based_handlers/).
|
|
74
|
-
## Why Wireup?
|
|
75
|
-
|
|
76
|
-
- **Correct by default**: Wireup catches missing dependencies, circular references, lifetime mismatches, duplicate registrations, and missing config keys at startup. Shared dependencies are created in a thread-safe way.
|
|
77
|
-
- **Define once, inject anywhere**: reuse the same service layer in APIs, CLIs, workers, and scripts.
|
|
78
|
-
- **Framework-ready**: native integrations for **FastAPI**, **Flask**, **Django**, **Starlette**, **AIOHTTP**, **ASGI**, **FastMCP**, **Celery**, **Click**, **Typer**, and **Strawberry**. [See Integrations](https://maldoinc.github.io/wireup/latest/integrations).
|
|
79
|
-
- **Startup-resolved constructor injection for [FastAPI](https://maldoinc.github.io/wireup/latest/integrations/fastapi/class_based_handlers/) and [AIOHTTP](https://maldoinc.github.io/wireup/latest/integrations/aiohttp/class_based_handlers/) handlers**: constructor dependencies are resolved once at startup, not per request. [FastAPI class-based handlers](https://maldoinc.github.io/wireup/latest/integrations/fastapi/class_based_handlers/).
|
|
80
|
-
- **Test overrides with context managers**: replace any injectable for a test scope and restore automatically. [See testing docs](https://maldoinc.github.io/wireup/latest/testing/).
|
|
81
|
-
- **Reusable sub-graphs**: run multiple configured instances of the same dependency graph without spinning up separate containers. [See reusable factory bundles](https://maldoinc.github.io/wireup/latest/factories/#reusable-factory-bundles).
|
|
82
|
-
|
|
83
112
|
## Installation
|
|
84
113
|
|
|
85
114
|
```bash
|
|
@@ -87,13 +116,20 @@ pip install wireup
|
|
|
87
116
|
```
|
|
88
117
|
|
|
89
118
|
|
|
90
|
-
##
|
|
119
|
+
## Quick Start
|
|
91
120
|
|
|
92
121
|
```python
|
|
122
|
+
import fastapi
|
|
123
|
+
import wireup
|
|
124
|
+
import wireup.integration.fastapi
|
|
125
|
+
from wireup import Injected, injectable
|
|
126
|
+
|
|
127
|
+
|
|
93
128
|
@injectable
|
|
94
129
|
class Database:
|
|
95
130
|
def query(self, sql: str) -> list[str]: ...
|
|
96
131
|
|
|
132
|
+
|
|
97
133
|
@injectable
|
|
98
134
|
class UserService:
|
|
99
135
|
def __init__(self, db: Database) -> None:
|
|
@@ -102,56 +138,29 @@ class UserService:
|
|
|
102
138
|
def get_users(self) -> list[str]:
|
|
103
139
|
return self.db.query("SELECT name FROM users")
|
|
104
140
|
|
|
141
|
+
|
|
105
142
|
app = fastapi.FastAPI()
|
|
106
143
|
|
|
144
|
+
|
|
107
145
|
@app.get("/users")
|
|
108
146
|
def get_users(service: Injected[UserService]) -> list[str]:
|
|
109
147
|
return service.get_users()
|
|
110
148
|
|
|
149
|
+
|
|
111
150
|
container = wireup.create_async_container(injectables=[Database, UserService])
|
|
112
151
|
wireup.integration.fastapi.setup(container, app)
|
|
113
152
|
```
|
|
114
153
|
|
|
115
|
-
For a
|
|
116
|
-
|
|
117
|
-
## Features
|
|
118
|
-
|
|
119
|
-
### ⚡ Clean & Type-Safe DI
|
|
120
|
-
|
|
121
|
-
Use decorators and annotations for concise, co-located definitions, or factories to keep your domain model pure and decoupled.
|
|
122
|
-
|
|
123
|
-
**1. Basic Usage**
|
|
124
|
-
|
|
125
|
-
Register classes with `@injectable` and let the container resolve dependencies automatically.
|
|
154
|
+
For a full end-to-end walkthrough, start with the [Getting Started guide](https://maldoinc.github.io/wireup/latest/getting_started/).
|
|
126
155
|
|
|
127
|
-
|
|
128
|
-
@injectable
|
|
129
|
-
class Database:
|
|
130
|
-
def __init__(self) -> None:
|
|
131
|
-
self.engine = sqlalchemy.create_engine("sqlite://")
|
|
132
|
-
|
|
133
|
-
@injectable
|
|
134
|
-
class UserService:
|
|
135
|
-
def __init__(self, db: Database) -> None:
|
|
136
|
-
self.db = db
|
|
137
|
-
|
|
138
|
-
container = wireup.create_sync_container(injectables=[Database, UserService])
|
|
139
|
-
|
|
140
|
-
# Inject via framework integration or @inject_from_container (recommended)
|
|
141
|
-
@app.get("/users")
|
|
142
|
-
def get_users(service: Injected[UserService]) -> list[str]: ...
|
|
156
|
+
## Basic Usage
|
|
143
157
|
|
|
144
|
-
|
|
145
|
-
user_service = container.get(UserService)
|
|
146
|
-
```
|
|
158
|
+
Wireup also supports config injection, decorator-free domain models, and package-level registration.
|
|
147
159
|
|
|
148
|
-
**
|
|
160
|
+
**1. Inject Configuration**
|
|
149
161
|
|
|
150
162
|
Inject configuration alongside dependencies. No need to write factories just to pass a config value.
|
|
151
163
|
|
|
152
|
-
<details>
|
|
153
|
-
<summary>View Code</summary>
|
|
154
|
-
|
|
155
164
|
```python
|
|
156
165
|
@injectable
|
|
157
166
|
class Database:
|
|
@@ -164,9 +173,7 @@ container = wireup.create_sync_container(
|
|
|
164
173
|
)
|
|
165
174
|
```
|
|
166
175
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
**3. Clean Architecture**
|
|
176
|
+
**2. Clean Architecture**
|
|
170
177
|
|
|
171
178
|
Need strict boundaries? Use factories to wire pure domain objects and integrate external libraries like Pydantic.
|
|
172
179
|
|
|
@@ -194,12 +201,9 @@ def make_database(settings: Settings) -> Database:
|
|
|
194
201
|
container = wireup.create_sync_container(injectables=[make_settings, make_database])
|
|
195
202
|
```
|
|
196
203
|
|
|
197
|
-
**
|
|
204
|
+
**3. Package-level registration**
|
|
198
205
|
|
|
199
|
-
No need to list every injectable manually.
|
|
200
|
-
|
|
201
|
-
<details>
|
|
202
|
-
<summary>View Code</summary>
|
|
206
|
+
No need to list every injectable manually. Provide entire modules or packages to register all at once.
|
|
203
207
|
|
|
204
208
|
```python
|
|
205
209
|
import app
|
|
@@ -214,11 +218,11 @@ container = wireup.create_sync_container(
|
|
|
214
218
|
)
|
|
215
219
|
```
|
|
216
220
|
|
|
217
|
-
|
|
221
|
+
## More Features
|
|
218
222
|
|
|
219
223
|
### 🎯 Function Injection
|
|
220
224
|
|
|
221
|
-
Inject dependencies into
|
|
225
|
+
Inject dependencies into CLI commands, background tasks, event handlers, or any standalone function that needs container access.
|
|
222
226
|
|
|
223
227
|
```python
|
|
224
228
|
@inject_from_container(container)
|
|
@@ -228,7 +232,7 @@ def migrate_database(db: Injected[Database], settings: Injected[Settings]) -> No
|
|
|
228
232
|
|
|
229
233
|
### 📝 Interfaces & Abstractions
|
|
230
234
|
|
|
231
|
-
|
|
235
|
+
Bind implementations to interfaces using Protocols or ABCs.
|
|
232
236
|
|
|
233
237
|
```python
|
|
234
238
|
class Notifier(Protocol):
|
|
@@ -238,17 +242,16 @@ class Notifier(Protocol):
|
|
|
238
242
|
class SlackNotifier:
|
|
239
243
|
def notify(self) -> None: ...
|
|
240
244
|
|
|
241
|
-
container = create_sync_container(injectables=[SlackNotifier])
|
|
242
|
-
|
|
243
245
|
# SlackNotifier is injected wherever Notifier is requested
|
|
244
246
|
@app.post("/notify")
|
|
245
247
|
def send_notification(notifier: Injected[Notifier]) -> None:
|
|
246
248
|
notifier.notify()
|
|
247
249
|
```
|
|
248
250
|
|
|
249
|
-
### 🏭
|
|
251
|
+
### 🏭 Factories & Resources
|
|
250
252
|
|
|
251
|
-
Defer instantiation to factories when initialization or cleanup is
|
|
253
|
+
Defer instantiation to specialized factories when complex initialization or cleanup is required.
|
|
254
|
+
Full support for sync, async, and generator factories. Wireup handles cleanup at the right time based on lifetime.
|
|
252
255
|
|
|
253
256
|
```python
|
|
254
257
|
class WeatherClient:
|
|
@@ -278,9 +281,9 @@ async def weather_client_factory() -> AsyncIterator[WeatherClient]:
|
|
|
278
281
|
</details>
|
|
279
282
|
|
|
280
283
|
|
|
281
|
-
### 🔄
|
|
284
|
+
### 🔄 Lifetimes & Scopes
|
|
282
285
|
|
|
283
|
-
Declare dependencies as singleton
|
|
286
|
+
Declare dependencies as `singleton`, `scoped`, or `transient` to control reuse explicitly.
|
|
284
287
|
|
|
285
288
|
```python
|
|
286
289
|
# Singleton: one instance per application (default)
|
|
@@ -306,36 +309,9 @@ class OrderProcessor:
|
|
|
306
309
|
pass
|
|
307
310
|
```
|
|
308
311
|
|
|
309
|
-
|
|
310
|
-
### ❓ Optional Dependencies
|
|
311
|
-
|
|
312
|
-
First-class support for `Optional[T]` and `T | None`.
|
|
313
|
-
|
|
314
|
-
```python
|
|
315
|
-
@injectable
|
|
316
|
-
def make_cache(settings: Settings) -> RedisCache | None:
|
|
317
|
-
return RedisCache(settings.redis_url) if settings.cache_enabled else None
|
|
318
|
-
|
|
319
|
-
@injectable
|
|
320
|
-
class UserService:
|
|
321
|
-
def __init__(self, cache: RedisCache | None) -> None:
|
|
322
|
-
self.cache = cache
|
|
323
|
-
|
|
324
|
-
# Retrieve optional dependencies directly when needed
|
|
325
|
-
cache = container.get(RedisCache | None)
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### 🧩 Reusable sub-graphs
|
|
329
|
-
|
|
330
|
-
Need to register multiple sub-graphs with different settings (e.g. primary + analytics DB)?
|
|
331
|
-
|
|
332
|
-
Wireup supports this natively without requiring a dedicated provider class or a separate container.
|
|
333
|
-
See [Reusable Factory Bundles](https://maldoinc.github.io/wireup/latest/factories/#reusable-factory-bundles).
|
|
334
|
-
|
|
335
|
-
|
|
336
312
|
### 🛡️ Startup Validation
|
|
337
313
|
|
|
338
|
-
Wireup validates the
|
|
314
|
+
Wireup validates the dependency graph when the container is created. See <a href="https://maldoinc.github.io/wireup/latest/what_wireup_validates/">What Wireup Validates</a> for the full rules and limits.
|
|
339
315
|
|
|
340
316
|
```python
|
|
341
317
|
# Missing dependencies: caught at startup, not at runtime
|
|
@@ -347,76 +323,25 @@ container = wireup.create_sync_container(injectables=[Foo])
|
|
|
347
323
|
# ❌ Parameter 'unknown' of 'Foo' depends on an unknown injectable 'NotManagedByWireup'.
|
|
348
324
|
```
|
|
349
325
|
|
|
350
|
-
|
|
351
|
-
container = wireup.create_sync_container(injectables=[])
|
|
326
|
+
It also catches circular dependencies, duplicate registrations, misconfigured lifetimes, and missing config at startup.
|
|
352
327
|
|
|
353
|
-
|
|
354
|
-
@inject_from_container(container)
|
|
355
|
-
def my_function(oops: Injected[NotManagedByWireup]): ...
|
|
356
|
-
# ❌ Parameter 'oops' of 'my_function' depends on an unknown injectable 'NotManagedByWireup'.
|
|
328
|
+
### 🧪 Testing
|
|
357
329
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
```python
|
|
361
|
-
# Missing config keys caught at startup
|
|
362
|
-
@injectable
|
|
363
|
-
class Database:
|
|
364
|
-
def __init__(self, url: Annotated[str, Inject(config="db_url")]) -> None: ...
|
|
365
|
-
|
|
366
|
-
container = wireup.create_sync_container(injectables=[Database], config={})
|
|
367
|
-
# ❌ Parameter 'url' of Type 'Database' depends on an unknown Wireup config key 'db_url'.
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
Additional checks: circular dependencies, lifetime mismatches (e.g. singleton depending on scoped), and duplicate registrations.
|
|
371
|
-
|
|
372
|
-
### 📍 Framework Independent
|
|
373
|
-
|
|
374
|
-
Define your service layer once. Run it anywhere.
|
|
375
|
-
|
|
376
|
-
```python
|
|
377
|
-
# Define once
|
|
378
|
-
# injectables = [UserService, Database, ...]
|
|
379
|
-
|
|
380
|
-
# FastAPI (native integration, no extra decorator needed)
|
|
381
|
-
@app.get("/users")
|
|
382
|
-
async def view(service: Injected[UserService]): ...
|
|
383
|
-
|
|
384
|
-
# Click
|
|
385
|
-
@click.command()
|
|
386
|
-
def command(service: Injected[UserService]): ...
|
|
387
|
-
|
|
388
|
-
# Use @inject_from_container to inject dependencies into any function.
|
|
389
|
-
# Most useful for scripts or when no Wireup integration is available.
|
|
390
|
-
@inject_from_container(container)
|
|
391
|
-
def run_worker(service: Injected[UserService]): ...
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
Have a useful integration to recommend? Create an issue or PR!
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
### 🔌 Framework Integrations
|
|
398
|
-
|
|
399
|
-
Native integrations manage request scopes, endpoint injection, and dependency lifetimes.
|
|
400
|
-
|
|
401
|
-
Supported: **FastAPI**, **Flask**, **Django**, **AIOHTTP**, **Starlette**, **Click**, **Typer**, **Strawberry**
|
|
402
|
-
|
|
403
|
-
[View all integrations →](https://maldoinc.github.io/wireup/latest/integrations/)
|
|
404
|
-
|
|
405
|
-
### 🧪 Simplified Testing
|
|
406
|
-
|
|
407
|
-
Wireup decorators only collect metadata. Injectables are plain classes and functions. Test them directly with no special setup.
|
|
330
|
+
Wireup decorators only collect metadata. Injectables are plain classes and functions, so you can test them directly with no special setup.
|
|
408
331
|
|
|
409
332
|
Swap dependencies during tests with `container.override`:
|
|
410
333
|
|
|
411
334
|
```python
|
|
412
335
|
with container.override.injectable(target=Database, new=in_memory_database):
|
|
413
|
-
#
|
|
336
|
+
# Injectables that depend on Database will receive in_memory_database
|
|
414
337
|
# for the duration of this context manager
|
|
415
338
|
response = client.get("/users")
|
|
416
339
|
```
|
|
417
340
|
|
|
418
341
|
## 📚 Documentation
|
|
419
342
|
|
|
343
|
+
See the docs for integrations, lifetimes, factories, testing, and more advanced patterns.
|
|
344
|
+
|
|
420
345
|
[https://maldoinc.github.io/wireup](https://maldoinc.github.io/wireup)
|
|
421
346
|
|
|
422
|
-
If Wireup
|
|
347
|
+
If Wireup is useful to you, a star on GitHub helps others find it.
|
|
@@ -9,15 +9,20 @@ nav:
|
|
|
9
9
|
- Container: container.md
|
|
10
10
|
- Injectables: injectables.md
|
|
11
11
|
- Configuration: configuration.md
|
|
12
|
-
-
|
|
12
|
+
- Features:
|
|
13
13
|
- Lifetimes & Scopes: lifetimes_and_scopes.md
|
|
14
14
|
- Factories: factories.md
|
|
15
15
|
- Resource Management: resources.md
|
|
16
16
|
- Interfaces: interfaces.md
|
|
17
17
|
- Function Injection: function_injection.md
|
|
18
|
+
- Advanced Patterns:
|
|
19
|
+
- Reusable Bundles: reusable_bundles.md
|
|
20
|
+
- Conditional Registration: conditional_registration.md
|
|
21
|
+
- Generic Dependencies: generic_dependencies.md
|
|
18
22
|
- Guides:
|
|
23
|
+
- Packaging Injectables: packaging_injectables.md
|
|
19
24
|
- Testing: testing.md
|
|
20
|
-
-
|
|
25
|
+
- What Wireup Validates: what_wireup_validates.md
|
|
21
26
|
- Upgrading: upgrading.md
|
|
22
27
|
- Versioning: versioning.md
|
|
23
28
|
|
|
@@ -28,7 +33,7 @@ nav:
|
|
|
28
33
|
- Django Integration: integrations/django/index.md
|
|
29
34
|
- Setup and Installation: integrations/django/setup.md
|
|
30
35
|
- Inject in Views: integrations/django/view_injection.md
|
|
31
|
-
- Request
|
|
36
|
+
- Request-Time Injection: integrations/django/request_time_injection.md
|
|
32
37
|
- App-Level Injection: integrations/django/app_injection.md
|
|
33
38
|
- Django Testing: integrations/django/testing.md
|
|
34
39
|
- Troubleshooting: integrations/django/troubleshooting.md
|
|
@@ -37,7 +42,7 @@ nav:
|
|
|
37
42
|
- Inject in Routes: integrations/fastapi/inject_in_routes.md
|
|
38
43
|
- Request and WebSocket Context in Services: integrations/fastapi/context_in_services.md
|
|
39
44
|
- Class Based Handlers: integrations/fastapi/class_based_handlers.md
|
|
40
|
-
- Request
|
|
45
|
+
- Request-Time Injection: integrations/fastapi/request_time_injection.md
|
|
41
46
|
- Background Tasks: integrations/fastapi/background_tasks.md
|
|
42
47
|
- FastAPI Testing: integrations/fastapi/testing.md
|
|
43
48
|
- Troubleshooting: integrations/fastapi/troubleshooting.md
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block outdated %}
|
|
4
|
+
You're not viewing the latest version.
|
|
5
|
+
<a href="{{ '../' ~ base_url }}">
|
|
6
|
+
|
|
7
|
+
<strong>Click here to go to latest.</strong>
|
|
8
|
+
</a>
|
|
9
|
+
{% endblock %}
|
|
10
|
+
|
|
11
|
+
{% block footer %}
|
|
12
|
+
{{ super() }}
|
|
13
|
+
<div class="md-footer">
|
|
14
|
+
<div class="md-footer-meta md-typeset">
|
|
15
|
+
<div class="md-footer-meta__inner md-grid">
|
|
16
|
+
<div class="md-copyright">
|
|
17
|
+
If Wireup is useful to you,
|
|
18
|
+
<a href="https://github.com/maldoinc/wireup" target="_blank" rel="noopener">a ⭐ on GitHub helps others find
|
|
19
|
+
it.</a>.
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
{% endblock %}
|
|
@@ -25,20 +25,20 @@ This benchmark uses an artificial workload to measure the overhead of the depend
|
|
|
25
25
|
services, the test focuses on how fast the library can resolve and inject dependencies without the results being hidden
|
|
26
26
|
by application logic.
|
|
27
27
|
|
|
28
|
-
Testing is done within a FastAPI + Uvicorn environment to measure performance in a realistic web-based environment
|
|
28
|
+
Testing is done within a FastAPI + Uvicorn environment to measure performance in a realistic web-based environment.
|
|
29
29
|
Notably, this also allows for the inclusion of `fastapi.Depends` in the comparison,
|
|
30
30
|
as it is the most popular choice by virtue of being the FastAPI default.
|
|
31
31
|
|
|
32
32
|
This setup tests also the overall dependency injection package of each library which includes container resolution, scoping,
|
|
33
33
|
injecting into functions/route handlers as well as framework integration rather than a microbenchmark where
|
|
34
|
-
you repeatedly resolve dependencies from the raw container instance in a tight loop
|
|
34
|
+
you repeatedly resolve dependencies from the raw container instance in a tight loop.
|
|
35
35
|
This benchmark intentionally uses non-trivial singleton/scoped graphs to stress test the containers.
|
|
36
36
|
|
|
37
37
|
The workload uses two separate, independent graphs:
|
|
38
38
|
the singleton graph (`Settings -> A -> B`) and the scoped graph (`C -> I`) where each service depends on multiple others.
|
|
39
39
|
H is a context manager, I is an async context manager.
|
|
40
40
|
|
|
41
|
-
This graph is intentionally non-trivial: large enough to emulate realistic container behavior, but still representative of practical applications (rather than
|
|
41
|
+
This graph is intentionally non-trivial: large enough to emulate realistic container behavior, but still representative of practical applications (rather than 100-node chains). The exact shape is less important than the workload characteristics: multiple dependencies and lifecycle-managed resources, which stress container resolution, scoping, and teardown more than a simple linear graph.
|
|
42
42
|
|
|
43
43
|
??? "Click to view the graphs"
|
|
44
44
|
|
|
@@ -99,8 +99,8 @@ For each run, the server is started, a liveness probe must pass, warmup traffic
|
|
|
99
99
|
Actual requests per second (RPS) will change based on your hardware. The most important metric is how the libraries
|
|
100
100
|
perform relative to each other.
|
|
101
101
|
|
|
102
|
-
**
|
|
103
|
-
|
|
102
|
+
**Manual Wiring (No DI)** represents the theoretical maximum performance. In this setup, services are manually instantiated
|
|
103
|
+
within the route handler, bypassing DI containers entirely.
|
|
104
104
|
This row exists purely to establish an upper bound on DI overhead, not as an endorsement of global state or manual wiring.
|
|
105
105
|
|
|
106
106
|
**Wireup Class-Based** represents the performance of Wireup when using the
|
|
@@ -120,6 +120,7 @@ The benchmark measures the following:
|
|
|
120
120
|
performance with fewer outliers. **Lower is better.**
|
|
121
121
|
- **RSS Memory Peak (MB)**: The highest post-iteration RSS sample observed across runs. **Lower is better.**
|
|
122
122
|
This includes the full server process footprint (Uvicorn + FastAPI app + framework runtime), not only service objects.
|
|
123
|
+
Summary percentages and relative-throughput comparisons on this page are computed from the main Median Run tables, not the Stability or Total Time tables.
|
|
123
124
|
|
|
124
125
|
### Hardware Environment
|
|
125
126
|
|
|
@@ -265,7 +266,7 @@ and Settings** from the graph.
|
|
|
265
266
|
This tests the container's bookkeeping performance and how efficiently it can return existing instances.
|
|
266
267
|
|
|
267
268
|
<!-- singleton-summary-start -->
|
|
268
|
-
In this benchmark, both **Wireup Class-Based** (<!-- meta:singleton_wireup_cbr_pct -->**99.93%**<!-- /meta:singleton_wireup_cbr_pct -->) and **Wireup** (<!-- meta:singleton_wireup_pct -->**98.97%**<!-- /meta:singleton_wireup_pct -->) operate
|
|
269
|
+
In this benchmark, both **Wireup Class-Based** (<!-- meta:singleton_wireup_cbr_pct -->**99.93%**<!-- /meta:singleton_wireup_cbr_pct -->) and **Wireup** (<!-- meta:singleton_wireup_pct -->**98.97%**<!-- /meta:singleton_wireup_pct -->) operate very close to manual wiring throughput, showing very small overhead vs manual wiring in this workload.
|
|
269
270
|
For context, this corresponds to roughly <!-- meta:singleton_wireup_vs_fastapi_x -->**2.15x**<!-- /meta:singleton_wireup_vs_fastapi_x --> the throughput of **FastAPI Depends** and <!-- meta:singleton_wireup_vs_next_best_x -->**1.25x**<!-- /meta:singleton_wireup_vs_next_best_x --> the next closest library in this benchmark (**<!-- meta:singleton_next_best_name -->diwire<!-- /meta:singleton_next_best_name -->**).
|
|
270
271
|
<!-- singleton-summary-end -->
|
|
271
272
|
|
|
@@ -337,8 +338,9 @@ Prerequisite:
|
|
|
337
338
|
|
|
338
339
|
Run from repository root:
|
|
339
340
|
|
|
340
|
-
|
|
341
|
-
|
|
341
|
+
```bash
|
|
342
|
+
make bench
|
|
343
|
+
```
|
|
342
344
|
|
|
343
345
|
Enable workload-shape assertions:
|
|
344
346
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## wireup.integration.fastapi
|
|
2
|
+
|
|
3
|
+
::: wireup.integration.fastapi
|
|
4
|
+
|
|
5
|
+
!!! note
|
|
6
|
+
For best performance with `WireupTask`, prefer regular top-level functions for background task callbacks.
|
|
7
|
+
Wireup creates cached injection wrappers for top-level functions, but callable objects and nested
|
|
8
|
+
functions/closures do not benefit from that caching.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## wireup.integration.flask
|
|
2
|
+
|
|
3
|
+
::: wireup.integration.starlette
|
|
4
|
+
|
|
5
|
+
!!! note
|
|
6
|
+
For best performance with `WireupTask`, prefer regular top-level functions for background task callbacks.
|
|
7
|
+
Wireup creates cached injection wrappers for top-level functions, but callable objects and nested
|
|
8
|
+
functions/closures do not benefit from that caching.
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# Conditional Registration
|
|
2
2
|
|
|
3
|
-
Wireup does not
|
|
3
|
+
Wireup does not use a special syntax for conditional registration. Build the `injectables` list in normal Python based
|
|
4
|
+
on environment, feature flags, or deployment mode, then pass the final list to the container.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
list to Wireup.
|
|
6
|
+
Wireup still validates the final graph when the container is created.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Bundle + If Pattern
|
|
8
|
+
## Bundle + If Statements
|
|
11
9
|
|
|
12
10
|
Use small bundle functions (or constants) and compose them with normal Python `if` statements.
|
|
13
11
|
|
|
@@ -74,35 +72,7 @@ else:
|
|
|
74
72
|
container = wireup.create_sync_container(injectables=injectables)
|
|
75
73
|
```
|
|
76
74
|
|
|
77
|
-
## Single Dependency Swap: Mailer
|
|
78
|
-
|
|
79
|
-
For one-off swaps, keep it simple and choose one injectable with a plain `if`:
|
|
80
|
-
|
|
81
|
-
```python
|
|
82
|
-
import os
|
|
83
|
-
import wireup
|
|
84
|
-
|
|
85
|
-
from my_app.services import UserService
|
|
86
|
-
from my_app.mail.dev_mailer import ConsoleMailer
|
|
87
|
-
from my_app.mail.prod_mailer import SesMailer
|
|
88
|
-
|
|
89
|
-
env = os.getenv("APP_ENV", "dev")
|
|
90
|
-
|
|
91
|
-
injectables = [UserService]
|
|
92
|
-
|
|
93
|
-
if env == "prod":
|
|
94
|
-
injectables.append(SesMailer)
|
|
95
|
-
else:
|
|
96
|
-
injectables.append(ConsoleMailer)
|
|
97
|
-
|
|
98
|
-
container = wireup.create_sync_container(injectables=injectables)
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Why Use This Pattern
|
|
102
75
|
|
|
103
|
-
|
|
104
|
-
* Composition stays explicit and local to app bootstrap.
|
|
105
|
-
* Wireup remains environment-agnostic.
|
|
106
|
-
* Validation still happens at startup for the graph you actually run.
|
|
76
|
+
## Next Steps
|
|
107
77
|
|
|
108
|
-
For
|
|
78
|
+
For cases where the same injectables need to be registered more than once with different settings, see [Reusable Bundles](reusable_bundles.md).
|