← Back to issue list

Python plugin: ship pyc files only

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1856242
Type
issue
State
open
Author
~om26er
Labels
Created
Updated
Closed

Current evaluation

Feature request to make the Python plugin ship only .pyc files (removing .py) to reduce snap size. Open since 2019, unlabelled, zero comments, no maintainer activity. The current craft-parts python plugin v2 no longer bytecompiles, so the premise is outdated.

Suggested action: close stale

Reason: The issue is 2454 days old with zero comments and no maintainer interaction. The current craft-parts python plugin v2 (craft_parts/plugins/python_v2/python_plugin.py) simply runs `pip install ${REQUIREMENTS} ${PACKAGES}` without any bytecompilation step, so the premise that the plugin bytecompiles .py files no longer holds. The original problem is no longer reproducible in the current codebase.

Impact: 30 Quick Win: 18.0 Staleness: 95 Complexity: 40 Confidence: 70 Support Request: 10

Issue body

Currently snapcraft bytecompiles .py files as part of the Python plugin, this is done to fasten startup time of snaps. Doing that increases the size of the snap, something that could be avoided. The snap should only ship pyc file and remove .py files. How to achieve that ? 1. pip install --no-compile 2. python3 -m compileall -b 3. find . -name '*.py' -type f -exec rm {} \;

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 18.0
Staleness: 95
Complexity: 40
Confidence: 70
Support Request: 10
close stale Feature request to make the Python plugin ship only .pyc files (removing .py) to reduce snap size. Open since 2019, unlabelled, zero comments, no maintainer activity. The current craft-parts python plugin v2 no longer bytecompiles, so the premise is outdated.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 10
close stale Request to modify the snapcraft Python plugin to ship only .pyc files instead of .py and .pyc to reduce snap size. Unlabelled, zero comments, and inactive for over 6 years.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 30
Confidence: 85
Support Request: 15
close stale Feature request to optimize the Snapcraft Python plugin by shipping only compiled .pyc files instead of source .py files to reduce snap size. Unaddressed for over six years with no maintainer feedback.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 20
Confidence: 85
Support Request: 10
close stale Request to modify the snapcraft Python plugin to ship only compiled .pyc files instead of source .py files to reduce snap size. Unaddressed for over six years with no maintainer feedback.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 20
Confidence: 85
Support Request: 10
close stale Feature request to optimize snapcraft's Python plugin by shipping only compiled .pyc files instead of source .py files to reduce snap size. Unaddressed for over 6 years.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2843 snap: only ship .pyc files, strip shared objects snapcraft closed Rejected. The maintainer closed the request, noting that removing source .py files and stripping shared objects is controversial and conflicts with project goals, despite the 15MB size reduction.
73%