← Back to issue list

Improvements to the PythonPlugin for core24

View original Github issue

Metadata

Project
snapcraft
Number
#4587
Type
issue
State
open
Author
tigarmo
Labels
—
Created
Updated
Closed
—

Current evaluation

Core24 Python-plugin support merged in #4666, but the proposed interpreter-symlink and default-shebang linters plus broader Python/GNOME integration work remain open and untriaged.

Suggested action: needs triage

Reason: The issue has no labels, assignee, or maintainer assessment; its only comment is an automated Jira-sync notice. Merged PR #4666 addressed core24 interpreter selection, but the current linter registry has no Python linter, and existing plugin logic does not implement the proposed core24 shebang rewrite or GNOME integration, so the four-part request needs decomposition and design review.

Evaluated by: mr-cal-bot

Impact: 58 Quick Win: 12 Complexity: 62 Confidence: 87 Actionability: 55

Issue body

### What needs to get done The story for Python snaps improved in `core24` but it's still a bit far from optimal. This issue is a bit of a braindump/discussion place for further improvements that we can do when targetting `core24` snaps: These two suggestions can be applied even if the Snapcraft project doesn't use the `python` plugin: ### 1) Add a linter that warns when a Python symlink points to a "probably invalid" interpreter (like pointing to `/usr/bin/python3` in classic snaps). Rationale: for the easy case of classic snaps, `/usr/bin/python3` comes from the user's machine and thus who knows which interpreter that is! There are also cases where the symlink can point to gnome-sdk's Python (when using the gnome extension). ### 2) Add a linter that warns when a Python script has the default shebang `#! /bin/env python3`. Rationale: similarly, because `/bin/env` will use the `PATH` it will very likely not pick up the correct `python3` (the one in `$SNAP/bin/python3`) because by default that directory comes very late in the search order. These suggestions are for when using the Python plugin specifically, in which case we have more control over the build: ### 3) Add a 'post-prime' step that fixes the shebangs in Python scripts to `#! /snap/<snapname>/current/bin/python3`. This would also alleviate suggestion 2; when we're getting ready to pack the final snap we know that the "correct" interpreter to use will live in `#! /snap/<snapname>/current/bin/python3`, so we might as well "hardcode" that. We should do that after `prime`, and not during `build`, so that the scripts still work during the build step. ### 4) Improve the interaction between the `python` plugin and the `gnome` extension. This one is a bit of a stretch-goal; snaps using the `gnome` extension have access to the sdk (during build) and the content snap (during runtime). So a Python project should use the sdk's Python interpreter during build (I assume it has special packages for building), but the content snap's interpreter during runtime. With this it should be straightforward to create a snap that has Python code that uses Gnome packages somehow (maybe Cairo?) ### Why it needs to get done To improve the UX of Python-based snaps

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 58
Quick Win: 12
Complexity: 62
Confidence: 87
Actionability: 55
needs triage Core24 Python-plugin support merged in #4666, but the proposed interpreter-symlink and default-shebang linters plus broader Python/GNOME integration work remain open and untriaged.
qwen/qwen3.6-35b-a3b
Impact: 35
Quick Win: 5
Complexity: 45
Confidence: 70
Actionability: 25
needs triage Discussion issue for Python plugin improvements in core24 including linters and post-prime shebang fixing. No maintainer engagement in 947 days.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 18
Staleness: 70
Complexity: 65
Confidence: 70
Support Request: 10
needs triage Braindump of four proposed improvements to the Python plugin for core24 (linter for bad interpreter symlinks, shebang linter, post-prime shebang rewriting, gnome extension interplay). Open, unlabelled, no maintainer response beyond a Jira sync bot; related core24 Python plugin work has since landed.
qwen/qwen3.6-35b-a3b
Staleness: 88
Complexity: 60
Confidence: 85
Support Request: 10
close stale Brainstorm discussion from 2023 outlining four UX improvements for Python snaps on core24. No maintainer engagement or concrete tasks identified in over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 88
Complexity: 45
Confidence: 75
Support Request: 15
close stale Outdated discussion post proposing Python plugin improvements for core24. No maintainer engagement in over a year, likely superseded by current implementations or practices.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#4666 (confidence 98%)

    Merged PR added core24 Python-plugin support and selected /usr/bin/python3.12, addressing foundational interpreter selection but not the proposed linters or GNOME integration.

Related issues

Issue Project State Summary Similarity
#4666 feat(plugins): support core24 in the Python plugin snapcraft merged Merged PR #4666 as commit 10352d96d, adding core24 Python plugin support with Python 3.12 for confined snaps and clearer strict/devmode interpreter selection.
74%
#5207 Python plugin with core24 and gnome extension broken snapcraft closed Core24 Python/GNOME breakage was confirmed resolved when the disabled Spread test passed again and was re-enabled by merged PR #5977 (commit 3743f75c4).
72%