Skip to content

Skip script collisions with entry points#339

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

Skip script collisions with entry points#339
Himanshuagrawal4 wants to merge 2 commits into
pypa:mainfrom
Himanshuagrawal4:PRO/installer-script-entrypoint-collision

Conversation

@Himanshuagrawal4

Copy link
Copy Markdown

Summary

  • track entry point scripts written during installation
  • skip .data/scripts files that would overwrite an already generated entry point script
  • emit a runtime warning for the skipped conflicting script
  • add a regression test for a wheel containing both forms with the same script name

Closes #315.

Validation

  • PYTHONPATH=src python -m pytest tests/test_core.py
  • python -m compileall -q src\installer
  • git diff --check

@Himanshuagrawal4 Himanshuagrawal4 marked this pull request as ready for review June 9, 2026 15:00
@eli-schwartz

Copy link
Copy Markdown
Contributor

"In the face of ambiguity, refuse the temptation to guess."

@Himanshuagrawal4

Copy link
Copy Markdown
Author

Thanks. I agree this is a policy choice. This PR follows one of the options from #315 and pip's current behavior: when a legacy script and generated entry point target the same script path, keep the generated entry point and skip the legacy script. Unlike pip, it emits a RuntimeWarning so callers can see that the wheel is ambiguous. Happy to change direction if maintainers prefer failing with a clearer error or exposing a policy knob instead.

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.

Can't unpack wheel when script and entry_point have the same name

2 participants