By running
uv run python -c "import uv_build_isolation_current_project"we simply expect the project to properly build and display 100.0 but it fails with the following error:
❯ uv sync
Using CPython 3.12.11
Creating virtual environment at: .venv
Resolved 1 package in 1ms
× Failed to build `uv-build-isolation-current-project @ file:///Users/tudoroancea/dev/uv-build-isolation-current-project`
├─▶ The build backend returned an error
╰─▶ Call to `scikit_build_core.build.build_editable` failed (exit status: 1)
[stderr]
Traceback (most recent call last):
File "<string>", line 8, in <module>
ModuleNotFoundError: No module named 'scikit_build_core'
hint: This usually indicates a problem with the package or the build environment.Given the all-in-one spirit of uv, I think it wouldn't be unreasonable to expect uv run and uv sync to preinstall the build dependencies before building the project when no-build-isolation is specified.
The workaround I found is to manually preinstall the build dependencies with uv pip:
uv venv
uv pip install scikit-build-core nanobind
uv run python -c "import uv_build_isolation_current_project"You can improve the above by introducing a dependency group build, and adding it to the default groups if you don't want uv sync to uninstall the build deps and force you to reinstall them before rebuilding the project.
Either way, creating a dependency group can also duplicate the dependency lists since we cannot include dependency groups in the build requirements.