Closed stephanlachnit closed 3 months ago
pip install creates a new venv to use instead, due to "build isolation".
meson-python will anyways install ninja as a pip-based build dependency if you don't have one on PATH, so no need to do so manually.
That's actually the problem. Since you're using an editable install, the ninja it installs inside the build isolation venv no longer exists when you try to rebuild the package.
You CANNOT use build isolation in combination with editable installs. Sadly, pip defaults to doing this so you have to magically know it doesn't work and disable it.
Editable installs are... advanced use cases, basically.
You have to use:
pip install -e . --no-build-isolation
See the docs in https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html for the background on why --no-build-isolation
is necessary.
Ah ok - so even when I want to use ninja
from a venv, I need to pass --no-build-isolation
?
Ah right, and with --no-build-isolation
I need to install meson-python
beforehand - quite annoying, thanks for your help!
Ah right, and with
--no-build-isolation
I need to installmeson-python
beforehand - quite annoying, thanks for your help!
Yeah but if you don't pass no-build-isolation then pip installs meson-python plus meson, compiles the project once, and uninstalls meson-python plus meson.
You might have meson already installed. I guarantee many other users of editable installs don't. :D
Yeah but if you don't pass no-build-isolation then pip installs meson-python plus meson, compiles the project once, and uninstalls meson-python plus meson.
I guess this is the annoying part - it would be nice if one could tell pip to leave those package persistently
it would be nice if one could tell pip to leave those package persistently
pip
devs don't seem to have much interest in this, but someone should just write a small wrapper to install build deps listed in pyproject.toml
into the development environment and then invoke pip install -e . --no-build-isolation
. This would be the most sensible behavior for any project with compiled code, independent of which build backend is used.
I'm currently having an issue using meson-python in an environment where I cannot install ninja system-wide.
In particular, I'm in a venv
Which results in the following ninja:
However, this doesn't work in the venv:
I also tried installing ninja in the venv and setting the
NINJA
env var, but this also doesn't work:which I think is because this is called outside of the venv -
ninja --version
in the venv is fine.