Skip to content

Defer EntryPoint value validation until loading - #547

Open
rudra337-lgtm wants to merge 1 commit into
python:mainfrom
rudra337-lgtm:fix/523-defer-entry-point-validation
Open

rudra337-lgtm wants to merge 1 commit into
python:mainfrom
rudra337-lgtm:fix/523-defer-entry-point-validation

Conversation

@rudra337-lgtm

Copy link
Copy Markdown

Fixes #523.

EntryPoint.__init__ previously parsed and validated value immediately. Since entry_points(group=...) constructs entries before applying the group filter, one malformed entry in an unrelated group could prevent callers from retrieving valid entries. Defer parsing until a component is accessed or load() is called; malformed entries still raise ValueError when used.

The regression test creates a distribution with a valid selected group and an invalid unselected group, verifies selection succeeds, and verifies loading the invalid entry still raises ValueError.

Validation:

  • tests/test_api.py: 38 passed, 39 subtests passed.
  • Existing TestEntryPoints unit tests: 8 passed.
  • Ruff and git diff --check passed.

AI assistance was used to prepare and validate this change; the reported checks were run locally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Using entry-point value for non-object references

1 participant