Skip to content

Conversation

@zooba
Copy link
Member

@zooba zooba commented Nov 25, 2025

Fixes #121

@zooba zooba marked this pull request as ready for review November 27, 2025 20:01
@zooba
Copy link
Member Author

zooba commented Dec 1, 2025

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.

@zooba zooba requested a review from Copilot December 9, 2025 21:07
Copy link

Copilot AI left a 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__.py companion 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.

@zooba
Copy link
Member Author

zooba commented Dec 9, 2025

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.

@zooba zooba merged commit e4a4451 into python:main Dec 9, 2025
4 checks passed
@zooba zooba deleted the gh-121 branch December 9, 2025 23:09
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.

Include pip in path

1 participant