I'm currently working around this in the snapcraft.yaml by deleting the conflicting files at the end of the build step and then generating the bytecode files in the prime step:
``` <part name>: plugin: python source: <source dir> override-build: | snapcraftctl build rm $SNAPCRAFT_PART_INSTALL/pyvenv.cfg find $SNAPCRAFT_PART_INSTALL/lib/python3.8/site-packages -name '*.pyc' -delete find $SNAPCRAFT_PART_INSTALL/lib/python3.8/site-packages -name 'RECORD' -delete rm -r $SNAPCRAFT_PART_INSTALL/bin/activate* override-prime: | snapcraftctl prime python -m compileall $SNAPCRAFT_PRIME/lib/python3.8/site-packages -q ```
It's a bit tedious duplicating this block for every python part (except one), though.
I'm currently working around this in the snapcraft.yaml by deleting the conflicting files at the end of the build step and then generating the bytecode files in the prime step:
```
override- build: |
snapcraftc tl build PART_INSTALL/ pyvenv. cfg PART_INSTALL/ lib/python3. 8/site- packages -name '*.pyc' -delete PART_INSTALL/ lib/python3. 8/site- packages -name 'RECORD' -delete PART_INSTALL/ bin/activate*
override- prime: |
snapcraftc tl prime PRIME/lib/ python3. 8/site- packages -q
<part name>:
plugin: python
source: <source dir>
rm $SNAPCRAFT_
find $SNAPCRAFT_
find $SNAPCRAFT_
rm -r $SNAPCRAFT_
python -m compileall $SNAPCRAFT_
```
It's a bit tedious duplicating this block for every python part (except one), though.