mirror of
https://github.com/astral-sh/uv
synced 2026-01-21 13:30:11 -05:00
Integration test uv_build package (#12058)
I somehow missed running an actual integration test of the PEP 517 API in CI and the python shim was using the old uv CLI interface still. The tests include pip, uv and `python -m build`. They must be a in CI job since we can't depend on the Python package in the Rust tests (we only get the binary in `cargo test`, not the `uv_build` wheel).
This commit is contained in:
48
.github/workflows/ci.yml
vendored
48
.github/workflows/ci.yml
vendored
@@ -1362,6 +1362,54 @@ jobs:
|
||||
UV_TEST_PUBLISH_CLOUDSMITH_TOKEN: ${{ secrets.UV_TEST_PUBLISH_CLOUDSMITH_TOKEN }}
|
||||
UV_TEST_PUBLISH_PYTHON_VERSION: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
integration-uv-build-backend:
|
||||
timeout-minutes: 10
|
||||
needs: build-binary-linux-libc
|
||||
name: "integration test | uv_build"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "${{ env.PYTHON_VERSION }}"
|
||||
|
||||
- name: "Download binary"
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: uv-linux-libc-${{ github.sha }}
|
||||
|
||||
- name: "Prepare binary"
|
||||
run: |
|
||||
chmod +x ./uv
|
||||
chmod +x ./uvx
|
||||
|
||||
- name: "Test uv_build package"
|
||||
run: |
|
||||
# Build the Python package, which is not covered by uv's integration tests since they can't depend on having
|
||||
# a Python package (only the binary itself is built before running Rust's tests)
|
||||
./uv build -v crates/uv-build
|
||||
|
||||
# Test the main path (`build_wheel`) through pip
|
||||
./uv venv -v --seed
|
||||
./uv run --no-project python -m pip install -v scripts/packages/built-by-uv --find-links crates/uv-build/dist --no-index --no-deps
|
||||
./uv run --no-project python -c "from built_by_uv import greet; print(greet())"
|
||||
|
||||
# Test both `build_wheel` and `build_sdist` through uv
|
||||
./uv venv -v
|
||||
./uv build -v --force-pep517 scripts/packages/built-by-uv --find-links crates/uv-build/dist --offline
|
||||
./uv pip install -v scripts/packages/built-by-uv/dist/*.tar.gz --find-links crates/uv-build/dist --offline --no-deps
|
||||
./uv run --no-project python -c "from built_by_uv import greet; print(greet())"
|
||||
|
||||
# Test both `build_wheel` and `build_sdist` through the official `build`
|
||||
rm -rf scripts/packages/built-by-uv/dist/
|
||||
./uv venv -v
|
||||
./uv pip install build
|
||||
# Add the uv binary to PATH for `build` to find
|
||||
PATH="$(pwd):$PATH" UV_OFFLINE=1 UV_FIND_LINKS=crates/uv-build/dist ./uv run --no-project python -m build -v --installer uv scripts/packages/built-by-uv
|
||||
./uv pip install -v scripts/packages/built-by-uv/dist/*.tar.gz --find-links crates/uv-build/dist --offline --no-deps
|
||||
./uv run --no-project python -c "from built_by_uv import greet; print(greet())"
|
||||
|
||||
cache-test-ubuntu:
|
||||
timeout-minutes: 10
|
||||
needs: build-binary-linux-libc
|
||||
|
||||
Reference in New Issue
Block a user