feat: allow defining arbitrary python interpreter for newer distros#108
feat: allow defining arbitrary python interpreter for newer distros#108ellisgeek wants to merge 4 commits intorundeck-plugins:masterfrom
Conversation
…ges for newer versions python implementing EXTERNALLY-MANAGED
|
@gschueler ?? |
|
Is there any update to this being merged? |
|
I guess we just have to wait unfortunately last activity was 3 months ago but the last committer is active in https://github.com/rundeck/rundeck |
|
we may have to maintain an internal build of this plugin in the meantime. |
|
@gschueler Could you help us out with this PR? |
There was a problem hiding this comment.
Pull request overview
This PR aims to support newer Linux distributions (e.g., Ubuntu 24.04 with PEP 668 “Externally Managed Environments”) by allowing users to point the plugin at an arbitrary Python interpreter (e.g., a venv Python) and by improving missing-dependency error messages to better guide users depending on whether they’re running against a system-managed interpreter.
Changes:
- Changes the plugin configuration to accept a free-form interpreter value (instead of a fixed select list).
- Detects “externally managed” system interpreters and adjusts missing-module error messages accordingly across the WinRM scripts.
- Expands
.gitignoreto include common Python/Gradle/Java ignores.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
plugin.yaml |
Switches interpreter config type to allow arbitrary interpreter values (currently only for one provider). |
contents/winrm-exec.py |
Adds externally-managed interpreter detection and improved dependency error messages. |
contents/winrm-filecopier.py |
Adds externally-managed interpreter detection and improved dependency error messages. |
contents/winrm-check.py |
Adds externally-managed interpreter detection and improved dependency error messages. |
.gitignore |
Replaces/expands ignore rules to include Python artifacts and additional Gradle/Java patterns. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| - name: interpreter | ||
| title: Python Interpreter | ||
| description: "Python Interpreter (Default: python)" | ||
| type: Select | ||
| values: "python,python2,python3" | ||
| type: String | ||
| default: "python" | ||
| required: true | ||
| scope: Instance |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Changed interpreter type from Select to String in plugin.yaml.
Ubuntu 24.04 and other distros are implementing the Externally Managed Environments spec to prevent the system interpreter from becoming contaminated. This means that most projects should use a virtual environment or restrict themselves to the python packages that are available from the distributions package manager.
This MR implements specifying an arbitrary path to a python interpreter to use when running this plugin as well as expanding the error messages that are printed when a module is missing.
Closes #105