Repository navigation
Fix plugin registration and removal to compare by identity - #770
Closed
himanshu748 wants to merge 1 commit into
Closed
himanshu748 wants to merge 1 commit into
himanshu748 wants to merge 1 commit into
Conversation
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.
Fixes #760.
Use object identity for plugin registration and lookup, and for removing a plugin's hook implementations. Distinct plugins that compare equal can be registered and unregistered independently, and registry operations do not invoke their equality methods. Registering the identical object under another name still raises
ValueError.Regression coverage includes equal dataclass instances, independent hook execution and removal by object/name, duplicate-object registration, a raising
__eq__, and blocked-name markers. This keeps public collection types and subset-hook behavior unchanged.Validation:
uv run pytest: 223 passed on CPython 3.12.14 with pytest 9.1.1.uv run pre-commit run -a: passed, including mypy. Both full checks passed again with--no-syncafter restoring the original lockfile.For local validation, the shallow checkout was completed with upstream version tags and the development dependencies were refreshed; the checked-in lockfile is unchanged by this PR.
AI-assisted contribution: implementation and validation were performed with OpenAI Codex, followed by independent agent review. No manual human review is claimed.