Repository navigation
Breaking renames, migration guide gaps and stale docs before 4.0.0 #614
Copy link
Copy link
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Milestone
Description
This was generated by AI during a third pre-4.0 audit of main at f6e343d.
Renames that are cheap only before 4.0.0, plus docs and docstrings that drifted from the code. None of the 13 integrations read the renamed names. Blocks the 4.0.0 tag.
Renames (breaking)
ProviderNotRegisteredError.provider_typeholds the requested type, whileDuplicateProviderTypeError.provider_typeholds a bound type. Rename to.dependency_type(the parameter name onresolve/find_provider). Reword "Provider of type <class 'x.B'> is not registered in providers registry." to "No provider is registered for B.", matching the troubleshooting page title. Updatedocs/providers/errors-and-exceptions.md:8anddocs/troubleshooting/missing-provider.md:10.FinalizerError(finalizer_errors=)andValidationFailedError(errors=)name attributes 4.0 replaced with.exceptions. Rename both keywords toexceptions=.
Migration guide gaps (docs/migration/to-4.x.md)
- The deleted modules
modern_di.registries.cache_registryandcontext_registry, and the private helpers removed frommodern_di.scope. One paragraph stating the four-public-modules rule (modern_di,.providers,.exceptions,.integrations). ArgumentResolutionError(...)now requirescreator=. The guide only mentions the renamed keywords.- Entries for every rename above and for the stricter
validate()from validate() bugs: Container under a custom scope enum, reference-only providers, Alias scope #612.
Stale text
- "context registry" (removed in perf: registry hooks, container-owned cache and context, cheaper child build (#605) #610):
modern_di/container.py:55,providers/context_provider.py:11,54,docs/providers/context.md:8,135,docs/troubleshooting/context-not-set.md:3. "cache registry":docs/providers/factories.md:274.docs/introduction/performance.md:255citesCacheRegistry.fetch_cache_item. docs/providers/errors-and-exceptions.md,InvalidChildScopeError: "(or the constructor receives a parent at an equal/shallower scope)". The constructor no longer takes a parent.docs/providers/lifecycle.md:232names the internalregister.docs/providers/container.md: H1 "Container provider" vs nav "Container"; the "Explicit injection" example annotates the parameter asContainer, contradicting its own reason.docs/providers/factories.md:108:finalizer=lambda res: res.close()fails pyright (resisobject). Use adef.types.P = ParamSpec("P")(modern_di/types.py:7) is unused in the package, tests and integrations. Delete.
Decided: CacheSettings.clear_cache keeps its name. It exists in 3.6.0, so a rename would break working code for little gain.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Activity
refactor!: rename ProviderNotRegisteredError.provider_type to depende…