Comment 9 for bug 1882535

Revision history for this message
William (wlaub) wrote (last edit ):

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.