Description
Pip's build isolation doesn't actually set up normal virtual environments, but instead hacks together one with environment variables and other hacks. This causes a bunch of issues, such as site-packages not being reported correctly (which we already work around, see comments in #880), and any tools with Python wrappers being broken, like cmake, ninja, uv, etc. uv has a built-in workaround for this. Should we add a workaround when calling cmake and ninja? We've already seen this with #973, but we could fix it so that it works, I think. The workaround is at https://github.com/astral-sh/ruff/pull/13591/files, we could similarly strip PYTHONPATH when calling cmake/ninja.
I'm probably first going to see if we can workaround it in each package. See scikit-build/cmake-python-distributions#586.