Python plugin: ship pyc files only
Bug #1856242 reported by
Omer Akram
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
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 {} \;
I created a pull request that uses the technique above but is only relevant to the Snapcraft snap https:/ /github. com/snapcore/ snapcraft/ pull/2843
We can update the Python plugin later...