Skip to content

feat: allow defining arbitrary python interpreter for newer distros#108

Open
ellisgeek wants to merge 4 commits intorundeck-plugins:masterfrom
ellisgeek:issues/105
Open

feat: allow defining arbitrary python interpreter for newer distros#108
ellisgeek wants to merge 4 commits intorundeck-plugins:masterfrom
ellisgeek:issues/105

Conversation

@ellisgeek
Copy link
Copy Markdown

@ellisgeek ellisgeek commented Dec 3, 2024

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

@Joris29
Copy link
Copy Markdown

Joris29 commented Jan 6, 2025

@gschueler ??

@MrDaGree
Copy link
Copy Markdown

MrDaGree commented Jan 7, 2025

Is there any update to this being merged?

@Joris29
Copy link
Copy Markdown

Joris29 commented Jan 14, 2025

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

@ellisgeek
Copy link
Copy Markdown
Author

we may have to maintain an internal build of this plugin in the meantime.

@Joris29
Copy link
Copy Markdown

Joris29 commented Apr 3, 2025

@gschueler Could you help us out with this PR?

@fdevans fdevans requested review from a team and Copilot March 18, 2026 21:34
Copy link
Copy Markdown

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 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 .gitignore to 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.

Comment on lines 25 to 31
- name: interpreter
title: Python Interpreter
description: "Python Interpreter (Default: python)"
type: Select
values: "python,python2,python3"
type: String
default: "python"
required: true
scope: Instance
ellisgeek and others added 2 commits March 25, 2026 15:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Changed interpreter type from Select to String in plugin.yaml.
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.

Python virtual env

4 participants