Skip to content

Installing dependencies before build fails when using uv and disabling build isolation #1955

Open
@burgholzer

Description

@burgholzer

Description

According to the cibuildwheel documentation, it is valid to disable build isolation for the wheel builds via

build-frontend = { name = "build[uv]", args = ["--no-isolation"] }

Naturally, this requires to install the build time dependencies manually.
However, specifying

before-build = "uv pip install scikit-build-core[pyproject]>=0.8.1 setuptools_scm>=7 pybind11>=2.13"

and then running cibuildwheel results in

Building cp38-manylinux_x86_64 wheel
CPython 3.8 manylinux x86_64

Setting up build environment...

    + /opt/python/cp38-cp38/bin/python -c 'import sys, json, os; json.dump(os.environ.copy(), sys.stdout)'
    + which python
    + which uv

                                                              ✓ 0.07s
Running before_build...

    + sh -c 'uv pip install scikit-build-core[pyproject]>=0.8.1 setuptools_scm>=7 pybind11>=2.13'
error: No virtual environment found

                                                              ✕ 3.16s
Error: Command ['sh', '-c', 'uv pip install scikit-build-core[pyproject]>=0.8.1 setuptools_scm>=7 pybind11>=2.13'] failed with code 2. 

This only seems to be happening under linux because for all the other operating systems, cibuildwheel explicitly calls uv venv ... in the "Setting up build environment..." step.

Build log

No response

CI config

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions