Adds shebang_templates configuration for overriding shebangs.#359
Merged
Conversation
Member
Author
|
Basically just waiting on more tests, but I also haven't tested thoroughly yet so I'm sure it'll break in places. Figured I'd put it out in the open now though - I'm hoping to get it done quickly and put out a beta with it (and the other recent changes). |
There was a problem hiding this comment.
Pull request overview
Adds configurable shebang_templates support so users can override/route non-standard (and POSIX-style) shebangs via pymanager.json, improving compatibility with legacy scripts and cross-platform shebang conventions.
Changes:
- Introduces
shebang_templatesconfig schema/defaults and wires it into shebang parsing. - Adds
_replace_templates()and integrates it into_parse_shebang()to rewrite or directly resolve template-based shebangs. - Expands tests and test config stubs to cover the new config field and parsing paths.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_scriptutils.py |
Adds tests for shebang template replacement and _parse_shebang integration. |
tests/test_install_command.py |
Updates test command stub to include shebang_templates. |
tests/conftest.py |
Updates fake config to include shebang_templates and aligns get_install_to_run signature with production. |
src/pymanager.json |
Adds default shebang_templates mappings. |
src/manage/scriptutils.py |
Implements template replacement and integrates it into shebang parsing/warnings. |
src/manage/commands.py |
Adds config schema + BaseCommand default for shebang_templates; adjusts default source_settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Steve Dower <steve.dower@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #307
Fixes #348