This is because the addition of wheel is done at the same time as yacron. You will either need 2 parts or, considering that yacron is your main deliverable, add it through use of source.
@sergiusens
Thanks for reply. I noticied that usr/lib/python3/dist-packages is not in sys.path, $SNAP/usr/lib/python3/dist-packages is neither in sys.path so within snap sandbox, python modules in $SNAP/usr/lib/python3/dist-packages can’t be imported. I think this is a bug. So the following worked for me:
name: yacron
version: 1.0.0
summary: yacron
description: A modern Cron replacement that is Docker-friendly
base: core20
confinement: devmode
parts:
yacron:
plugin: python
build-environment:
- PYTHONPATH: "$SNAPCRAFT_PART_INSTALL/usr/lib/python3/dist-packages"
stage-packages:
- python3-wheel
python-packages:
- yacron
I really like your solution, I’ll have to test it out. One thing that I found worked as well was a build override, this is a snippet from my own snap which had this issue which also fixes this problem, albeit not as nicely as your solution:
It is also nice solution, but the thing is usr/lib/python3/dist-packages is not in sys.path, thus any prebuild python packages installed under stage-packages that goes to usr/lib/python3/dist-packages is not recognized neither by snapcraaft nor snap. For example I have to write this