diff --git a/.github/actions/build-wheel/action.yml b/.github/actions/build-wheel/action.yml index 5f5127e0..e29347c8 100644 --- a/.github/actions/build-wheel/action.yml +++ b/.github/actions/build-wheel/action.yml @@ -118,9 +118,11 @@ runs: # - cibw will change its cwd to a temp dir and create a separate venv for testing. It then installs the wheel it # built into that venv, and run the CIBW_TEST_COMMAND. We have to install all dependencies ourselves, and make # sure that the pytest config in pyproject.toml is available. - # - CIBW_BEFORE_TEST installs the test dependencies by exporting them into a pylock.toml. At the time of writing, - # `uv sync --no-install-project` had problems correctly resolving dependencies using resolution environments - # across all platforms we build for. This might be solved in newer uv versions. + # - CIBW_BEFORE_TEST installs the test dependencies with `uv sync --active --only-group test --no-install-project` + # into cibw's test venv. Exporting them into a pylock.toml instead downloads every wheel of the resolution that + # has no index hash (a new torch release's, for every platform) to compute one. An older uv had trouble + # resolving the sync across our resolution environments (tool.uv.environments in pyproject.toml); look there if + # a platform fails. # - CIBW_TEST_COMMAND specifies pytest conf from pyproject.toml. --confcutdir is needed to prevent pytest from # traversing the full filesystem, which produces an error on Windows. # - CIBW_TEST_SKIP we always skip tests for *-macosx_universal2 builds, because we run tests for arm64 and x86_64. @@ -132,8 +134,7 @@ runs: CIBW_TEST_SKIP: ${{ inputs.testsuite == 'none' && '*' || '*-macosx_universal2' }} CIBW_TEST_SOURCES: tests CIBW_BEFORE_TEST: > - uv export --only-group test --no-emit-project --quiet --output-file pylock.toml --directory {project} && - uv pip install -r pylock.toml + uv sync --active --inexact --only-group test --no-install-project --directory {project} CIBW_TEST_COMMAND: > uv run -v pytest --confcutdir=. --rootdir . -c {project}/pyproject.toml ${{ inputs.testsuite == 'fast' && './tests/fast' || './tests' }} diff --git a/.github/workflows/packaging_sdist.yml b/.github/workflows/packaging_sdist.yml index a76a55fa..8a70cd79 100644 --- a/.github/workflows/packaging_sdist.yml +++ b/.github/workflows/packaging_sdist.yml @@ -89,10 +89,11 @@ jobs: - name: Test sdist if: ${{ inputs.testsuite != 'none' }} run: | - # install the test requirements - uv export --only-group test --no-emit-project --output-file ${{ runner.temp }}/pylock.toml --quiet + # install the test requirements next to the sdist already in the venv; a sync installs only this + # platform's wheels, where an export to a pylock downloads every hashless wheel of the resolution (a new + # torch release's, for every platform) to compute its hash + UV_PROJECT_ENVIRONMENT="${{ runner.temp }}/.venv" uv sync --only-group test --no-install-project --inexact cd ${{ runner.temp }} - uv pip install -r pylock.toml # run tests tests_root="${{ github.workspace }}/tests" tests_dir="${tests_root}${{ inputs.testsuite == 'fast' && '/fast' || '/' }}" diff --git a/.github/workflows/packaging_wheels.yml b/.github/workflows/packaging_wheels.yml index 205b30d9..1e2275dd 100644 --- a/.github/workflows/packaging_wheels.yml +++ b/.github/workflows/packaging_wheels.yml @@ -243,8 +243,9 @@ jobs: run: | set -eo pipefail uv venv --python "${{ matrix.python }}" .venv-wheel - uv export --only-group test --no-emit-project --quiet --output-file pylock.toml - uv pip install --python .venv-wheel -r pylock.toml + # A sync installs only this platform's wheels; an export to a pylock downloads every wheel of the universal + # resolution that has no index hash to compute one, such as a new torch release's wheels for every platform. + UV_PROJECT_ENVIRONMENT="$PWD/.venv-wheel" uv sync --only-group test --no-install-project --python "${{ matrix.python }}" uv pip install --python .venv-wheel wheelhouse/*.whl venv="$PWD/.venv-wheel" testrun=$(uv run --no-project --python "$venv" python -c 'import tempfile; print(tempfile.mkdtemp(prefix="duckdb-testrun-"))')