Yes to both your questions.
This is the relevant python part:
crbs: plugin: python source: . source-type: local requirements: - requirements.txt build-packages: - git - libffi-dev - libpq-dev - python3-setuptools stage-packages: - libpq5 - libxml2 filesets: bins: - bin/alembic - bin/crbs-admin - bin/crbs-asyncapi - bin/uwsgi - bin/snap-helpers* - bin/python - bin/python3 prime: - $bins - etc - lib - usr/lib override-build: | set -e snapcraftctl build snapcraftctl set-version $($SNAPCRAFT_PROJECT_DIR/snap/local/snap-version) snap-helpers write-hooks
With snapcraft 4.0.1+git1.ge9d758fa (4730) if I put the followig in the configure hook:
which python3 python3 -c 'import sys; print(sys.path)'
I get:
/snap/canonical-rbac/x1/bin/python3 ['', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/lib/python3/dist-packages']
If I append $SNAP/lib/python3.8/site-packages to sys.path at the beginning of the python script called by the hook, it works.
Yes to both your questions.
This is the relevant python part:
crbs: PROJECT_ DIR/snap/ local/snap- version)
plugin: python
source: .
source-type: local
requirements:
- requirements.txt
build-packages:
- git
- libffi-dev
- libpq-dev
- python3-setuptools
stage-packages:
- libpq5
- libxml2
filesets:
bins:
- bin/alembic
- bin/crbs-admin
- bin/crbs-asyncapi
- bin/uwsgi
- bin/snap-helpers*
- bin/python
- bin/python3
prime:
- $bins
- etc
- lib
- usr/lib
override-build: |
set -e
snapcraftctl build
snapcraftctl set-version $($SNAPCRAFT_
snap-helpers write-hooks
With snapcraft 4.0.1+git1. ge9d758fa (4730) if I put the followig in the configure hook:
which python3
python3 -c 'import sys; print(sys.path)'
I get:
/snap/canonical -rbac/x1/ bin/python3 python38. zip', '/usr/lib/ python3. 8', '/usr/lib/ python3. 8/lib-dynload' , '/usr/lib/ python3/ dist-packages' ]
['', '/usr/lib/
If I append $SNAP/lib/ python3. 8/site- packages to sys.path at the beginning of the python script called by the hook, it works.