uv/scripts/packages/built-by-uv/test.sh
konsti 3a7db17147
Build backend: Add source tree -> source dist -> wheel tests (#9091)
A first milestone: source tree -> source dist -> wheel -> install works.
This PR adds a test for this.

There's obviously a lot still missing, including basics such as the
Readme inclusion.
2024-11-14 19:15:32 +00:00

23 lines
703 B
Bash

#!/bin/bash
# Test source tree -> source dist -> wheel and run pytest after.
# We can't test this through the build backend setting directly since we want
# to use the debug build of uv, so we use the internal API instead.
set -e
cargo build
uv venv -p 3.12 -q
mkdir -p dist
rm -f dist/*
../../../target/debug/uv build-backend build-sdist dist/
rm -rf build-root
mkdir build-root
cd build-root
tar -tvf ../dist/built_by_uv-0.1.0.tar.gz
tar xf ../dist/built_by_uv-0.1.0.tar.gz
cd built-by-uv-0.1.0
../../../../../target/debug/uv build-backend build-wheel ../../dist
unzip -l ../../dist/built_by_uv-0.1.0-py3-none-any.whl
cd ../..
uv pip install -q pytest dist/built_by_uv-0.1.0-py3-none-any.whl
pytest