I am not sure if this is necessarily a bug but it seems like something that should be discussed and people be made aware about. This concerns the development setup of scikit-image but may generalize to any project that uses spin.
meson-python supports editable installs. However, these seem to override spin's path manipulation completely. E.g. for scikit-image, first follow Installing scikit-image for contributors (venv) and then run
spin python -- -c 'import skimage; print(skimage)'
pip install -vv --no-build-isolation -e .
spin python -- -c 'import skimage; print(skimage)'
the first spin python will find the module in REPO/build-install/... as expected. However, after running pip install -e the module is different: <module 'skimage' from 'REPO/skimage/__init__.py'>. Running pip uninstall -y scikit-image will restore the original and expected behavior of spin.
So using both meson-python's editable installs and spin together has the consequence that most spin commands trigger two compilations: once from spin build and once from the editable hook during import.
Ideally spin could make sure that build-install is always used regardless of an editable hook being present. But not sure if that's easily possible or feasible...
See also this thread on scikit-image's Zulip that triggered this issue.
I am not sure if this is necessarily a bug but it seems like something that should be discussed and people be made aware about. This concerns the development setup of scikit-image but may generalize to any project that uses spin.
meson-python supports editable installs. However, these seem to override spin's path manipulation completely. E.g. for scikit-image, first follow Installing scikit-image for contributors (venv) and then run
the first
spin pythonwill find the module inREPO/build-install/...as expected. However, after runningpip install -ethe module is different:<module 'skimage' from 'REPO/skimage/__init__.py'>. Runningpip uninstall -y scikit-imagewill restore the original and expected behavior of spin.So using both meson-python's editable installs and spin together has the consequence that most spin commands trigger two compilations: once from
spin buildand once from the editable hook during import.Ideally spin could make sure that
build-installis always used regardless of an editable hook being present. But not sure if that's easily possible or feasible...See also this thread on scikit-image's Zulip that triggered this issue.