← Back to issue list

plugins: refactor python plugin for subclassing

View original Github issue

Metadata

Project
craft-parts
Number
#384
Type
pull request
State
merged
Author
cmatsuoka
Labels
Created
Updated
Closed

Current evaluation

Merged after review and CI approval. Refactored the Python plugin to enable subclassing and method overriding, allowing custom logic for determining the interpreter location. Rebased on main prior to merge.

Suggested action:

No scores available.

Issue body

The location of the Python interpreter executable can depend on application-specific parameters that cannot be determined by a generic parts plugin. To address that, allow applications to subclass and override methods in the Python plugin in order to use custom logic to set the interpreter location. Co-authored-by: Tiago Nobrega <tiago.nobrega@canonical.com> Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com> - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- CRAFT-1629

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after review and CI approval. Refactored the Python plugin to enable subclassing and method overriding, allowing custom logic for determining the interpreter location. Rebased on main prior to merge.
qwen3.6-35b-a3b-mtp-q6 Merged a refactor of the Python plugin to enable subclassing and method overriding for custom interpreter location logic. Co-authored by Tiago Nobrega and Claudio Matsuoka. Rebased on main before integration. Resolves CRAFT-1629.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#389 plugins: refactor python plugin for subclassing craft-parts merged Merged a refactor of the Python plugin to enable subclassing and method overriding for custom interpreter location logic. Approved by one reviewer, passed CI checks, and modified three files.
94%
#311 plugins: fix python shebang rockcraft merged Merged a fix for the Python shebang in plugins. The change replaces hardcoded interpreters with ${PARTS_PYTHON_INTERPRETER} to respect user overrides. Approved by two reviewers and merged.
74%
#771 Python plugin improvements snapcraft merged Merged Python plugin improvements after reviewer approval. Entry point conflicts were resolved via filesets and integration tests passed. Documentation and unit test updates remain pending but did not block the merge.
72%
#819 feat(plugins): create base Python plugin craft-parts merged Merged a base Python plugin enabling multiple Python plugins with different build systems. Approved by two reviewers, passed CI, and modified five files with 384 additions and 164 deletions.
72%
#1319 docs: add new Python plugin to the changelog craft-parts merged Merged after approval from two reviewers. The pull request documents a new Python plugin by adding an entry to the changelog. CI checks passed and changes were integrated into the main branch.
71%
#392 plugins: fix pip path in python plugin craft-parts merged Merged a fix ensuring the python plugin uses the venv pip path, preventing unintended package installations when PATH changes. Approved by one reviewer, passed CI checks, and modified five files.
71%
#1547 plugins: extract sitecustomize logic from python snapcraft merged Merged a refactoring change extracting sitecustomize.py logic from the Python plugin into a shared module. Approved and passing CI, this prepares the codebase for the subsequent pip extraction without altering current functionality.
71%
#1549 plugins: extract pip from python plugin snapcraft merged Merged a refactor extracting the pip wrapper from the Python plugin. Introduces a public API to improve reusability and testability. Approved by two reviewers with passing CI checks, advancing a larger plugin extraction effort.
70%