Python plugin: ship pyc files only

Bug #1856242 reported by Omer Akram
6
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 {} \;

Omer Akram (om26er)
description: updated
Revision history for this message
Omer Akram (om26er) wrote :

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...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.