Skip to content

Fix Self dependencies when copying containers - #990

Open
Aschenbath wants to merge 1 commit into
ets-labs:developfrom
Aschenbath:fix/copy-self-dependencies-619
Open

Aschenbath wants to merge 1 commit into
ets-labs:developfrom
Aschenbath:fix/copy-self-dependencies-619

Conversation

@Aschenbath

Copy link
Copy Markdown

Copying a container with a Self dependency currently injects the original container class instead of the copied container instance. Seed the copy memo with the destination container's canonical Self provider so inherited and locally declared dependencies share the provider that is rebound during instantiation.

Add regression coverage for instance isolation, destination aliases, delegated/provided dependencies, repeated copying and deep copying, resource lifecycle, and nested containers. Document the copied Self behavior.

Fixes #619. Fixes #675.

Validation:

  • All six new tests fail against the original native extensions and pass after rebuilding.
  • Full unit suite: 1,393 passed, 2 skipped (CPython 3.12); original: 1,387 passed, 2 skipped.
  • Flake8, pydocstyle, strict mypy, sdist/wheel build, and twine check pass; installed wheel passes all six regressions.
  • Sphinx builds successfully. Existing changelog diagnostics and the non-blocking pylint diagnostics match the original version exactly.

Independent Codex review exercises 192 scenarios across 12 provider families, inheritance, aliases and repeated copying: 2,688 assertions pass against both the compiled candidate and installed wheel, while the original fails 1,056 identity checks. Another 24 checks cover nested containers, external Self providers and destination overrides; the original fails six and both fixed packages pass all 24.

Copied dependencies now use the destination canonical Self and its overrides. Source Self overrides stay with the source. Inherited source Self alias registration remains outside this fix.

AI assistance: OpenAI Codex investigated, implemented and tested the change. A separate Codex agent reviewed the complete patch and ran the independent native-package checks above. No human review is claimed. Other OS/Python versions and the hosted CI matrix were not run locally.

This branch has not been deployed

No deployments
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