-
Notifications
You must be signed in to change notification settings - Fork 24
Create shortcut executables from registered entrypoints #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This won't be merged until after the next release, so it'll go out in 2026. The likelihood of it needing follow-up fixes is too high to do it right before the Christmas break. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds functionality to automatically create executable shortcuts from registered Python entrypoints (e.g., pip, pytest) found in installed packages. The implementation scans dist-info directories for entry_points.txt files, parses console_scripts and gui_scripts sections, and creates wrapper executables that launch these scripts through the appropriate Python runtime.
Key Changes:
- New aliasutils module handles entrypoint scanning, alias calculation, and executable creation
- Refactored install_command to delegate alias management to the new module
- Enhanced launcher.cpp to support executing Python scripts via
.__script__.pycompanion files - Fixed Path.stem and Path.suffix properties to handle multi-dot filenames correctly
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| src/manage/aliasutils.py | New module implementing entrypoint scanning, alias creation, and cleanup logic |
| src/manage/install_command.py | Refactored to use new aliasutils module; improved error handling for missing imports |
| src/manage/pathutils.py | Fixed stem/suffix properties to correctly handle filenames without extensions |
| src/manage/exceptions.py | Added NoLauncherTemplateError exception |
| src/pymanager/launcher.cpp | Added get_script() to detect and inject script files into argv |
| src/pymanager/_launch.cpp | Updated launch() signature to accept original command line and insert_args |
| src/pymanager/main.cpp | Updated launch() call with new signature |
| tests/test_alias.py | Comprehensive tests for new alias functionality |
| tests/test_install_command.py | Updated tests for refactored preserve_site function |
| tests/test_pathutils.py | Added tests for stem/suffix edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Going to merge now as I'm happy enough, and have pretty thoroughly tested scenarios I can think of, and there are no releases planned until next year. So it may as well sit in main and get more exercise. If we need to patch the current release again, we'll just have to branch before this. |
Fixes #121