← Back to issue list

feat(plugins): new usrmerge-ready Python plugin

View original Github issue

Metadata

Project
craft-parts
Number
#1264
Type
pull request
State
merged
Author
tigarmo
Labels
PR: Squash
Created
Updated
Closed

Current evaluation

Merged PR #1264 as commit 39557f3a, adding an opt-in Python v2 plugin using pip --user and sitecustomize for usrmerged payloads.

Resolution: closed resolved

Reason: PR #1264 was merged as commit 39557f3a. The plugin avoids hardcoded virtual environments by installing into the part's user base and adding sitecustomize support for primed interpreters.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The original Python plugin is incompatible with usrmerged systems because the virtual environment directory structure that it needs is very hardcoded. This new plugin does not use virtual environments; instead, during the build the plugin uses the part's install dir as the base for "pip install --user" calls. A sitecustomize file is provided so that at runtime the interpreter can pick up the packages installed by pip. Since this sitecustomize has to be discoverable, this means that the plugin assumes that the interpreter will be included in the primed payload (which is true for Rockcraft, and will be true for Snapcraft starting with core26). This new plugin is not registered by default; applications wanting to use it, typically in conjunction with usrmerged install dirs, need to explicitly register it *over* the default Python plugin.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #1264 as commit 39557f3a, adding an opt-in Python v2 plugin using pip --user and sitecustomize for usrmerged payloads.
stealth/space-bunny-alpha — closed resolved Merged PR #1264 added a usrmerge-ready Python plugin using pip --user and sitecustomize, avoiding hardcoded virtualenv layouts.
qwen/qwen3.6-35b-a3b — — Merged a new usrmerge-compatible Python plugin using pip install --user instead of virtual environments. Requires explicit registration over the default plugin. Approved by reviewers and passed CI checks.
qwen3.6-35b-a3b-mtp-q6 — — Squash-merged a new usrmerge-compatible Python plugin using pip install --user instead of hardcoded virtual environments. Requires explicit registration to override the default plugin. Test failures were linked to separate related PRs.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-parts#1262 (confidence 96%)

    Companion change adding default support for usrmerged part install directories.

  • Related To: canonical/craft-parts#1308 (confidence 95%)

    A maintainer identified this PR as the source of related test failures.

  • Related To: canonical/craft-parts#1316 (confidence 95%)

    A maintainer identified this PR as the source of related test failures.

Related issues

Issue Project State Summary Similarity
#246 usrmerge issue when using the Python plugin without provisioning Python rockcraft closed Fixed by merged PR #498, which removes the Python plugin's primed lib64 symlink that broke the Ubuntu 24.04 usrmerge layout.
70%