Repository navigation
Remove distribution metadata when unregistering plugins - #764
Closed
jovial-liu wants to merge 1 commit into
Closed
jovial-liu wants to merge 1 commit into
jovial-liu 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.
After unloading an entry-point plugin, both distribution-list APIs still include it; loading it again adds a duplicate row. This also affects consumers such as pytest's plugin header.
Remove metadata for the registry object actually removed by
unregister(), using identity checks and updating the existing metadata list in place. The regression loads two plugins through real on-disk.dist-infoentry points, then checks removal by object/name/both arguments, an equal lookup object, blocking, preservation of the sibling plugin, and reloading through both distribution-list APIs. Add a bugfix changelog fragment.Fixes #763. This complements the unregister argument validation and falsey-plugin handling in #759.
Validation on macOS, CPython 3.12.14:
uv run --with 'pytest>=8' --with 'pytest-benchmark>=4' --with-editable . pytest.uv run pre-commit run -a: all hooks passed, including Ruff, autoflake, documentation checks, and mypy. Hook-modified files were reread and the full suite was rerun.The repository's
uv.lockcurrently pins pytest 3.2.5, which fails to start on Python 3.12 because it importsimp. The temporary test overlay uses the checkout's editable pluggy; the lock file is unchanged.Prepared and tested with OpenAI Codex, with an independent agent code review. No manual human review is claimed.