Skip to content

Raise InvalidEntryPoint for invalid entry points#338

Open
Himanshuagrawal4 wants to merge 2 commits into
pypa:mainfrom
Himanshuagrawal4:PRO/installer-entrypoint-error
Open

Raise InvalidEntryPoint for invalid entry points#338
Himanshuagrawal4 wants to merge 2 commits into
pypa:mainfrom
Himanshuagrawal4:PRO/installer-entrypoint-error

Conversation

@Himanshuagrawal4

Copy link
Copy Markdown

Summary

  • add an InvalidEntryPoint exception for invalid entry_points.txt entries
  • raise the clearer exception from parse_entrypoints() instead of surfacing a bare AssertionError
  • add regression coverage for direct parsing and the install() path

Rationale

When a wheel contains an invalid entry point target, parse_entrypoints() currently fails with AssertionError, which does not tell users which entry was invalid or why parsing failed. The new exception keeps the failure explicit while carrying the section, name, value, and reason so installers and callers can present a useful message.

Fixes #198.

Testing

  • PYTHONPATH=src python -m pytest

@Himanshuagrawal4 Himanshuagrawal4 marked this pull request as ready for review June 3, 2026 07:25
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.

Add wheel file validation for entry_points.txt

1 participant