Skip to content

Conversation

@zooba
Copy link
Member

@zooba zooba commented Dec 9, 2025

Fixes #235

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 the ability to install Python runtimes based on the shebang line found in a script file. This addresses issue #235 by allowing the install command to read a script's shebang (e.g., #! python1.1.exe) and automatically install the corresponding runtime if it's not already present.

Key changes:

  • Modified install_command.py to extract runtime specifications from script shebangs when the --from-script flag is used
  • Replaced global DOWNLOAD_CACHE with a per-command cache stored in cmd.scratch for better testability
  • Added test infrastructure and test cases to verify the new functionality

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
src/manage/install_command.py Added logic to parse shebang from scripts and extract runtime tags; replaced global DOWNLOAD_CACHE with cmd.scratch-based caching
tests/test_install_command.py Added InstallCommandTestCmd helper class and test cases for script-based installation
tests/conftest.py Modified assert_log to perform type conversion when comparing logged values with expected values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zooba zooba merged commit 682d0f8 into python:main Dec 11, 2025
4 checks passed
@zooba zooba deleted the gh-235 branch December 11, 2025 00:26
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.

Fails to auto-install runtime from shebang

1 participant