pyproject.toml file, pip will by default install the build dependencies in a temporary directory.
Is it conceivable to not install a dependency in the temp dir in case that dependency is already satisfied?
We maintain a package (scikit-learn) that has Cython and numpy as build dependencies. Cython compiles .pyx files to .c which are then compiled to python extensions. Some of the generated .c files depend on some numpy C headers.
We’re considering adding a
However, this causes numpy to be installed in the temporary env everytime
pip install -e . is run. As a result, Cython believes that the .pyx files that depend on numpy need to be re-compiled, since numpy itself is considered “new”. This means that every time we use
pip install -e ., lots of our Cython files are re-compiled even though none of them actually changed.
I believe that if numpy wasn’t installed in the temp directory, we wouldn’t have this issue. Pip could just be using the already-installed numpy in the env (as long as it satisfies the constraints in the
We can also just use
--no-build-isolation, but I am concerned that adding the
.toml file changes pip’s default behavior.