diff --git a/pyproject.toml b/pyproject.toml index 9cb6801..4974087 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,13 @@ build-frontend = { name = "build[uv]", args = ["--no-isolation"] } build-verbosity = 1 test-requires = ["pytest", "pytest-cov", "PyYAML", "scipy"] before-build = [ - "pip install pip-tools && pip-compile --all-build-deps -o \"{project}/build-reqs.txt\" && pip install -r \"{project}/build-reqs.txt\"" + # These two lines get the build requirements from `pyproject.toml` + "pip install pip-tools", + "pip-compile --all-build-deps -o \"{project}/build-reqs.txt\" \"{project}/pyproject.toml\"", + # We install them since we're building without isolation. + "pip install -r \"{project}/build-reqs.txt\"", + # We remove the residual *.so files specific to a CPython version from the last build. + "find \"{project}\" -name *.cpython-*.so -type f -delete" ] before-test = "uv pip install --no-deps sparse@git+https://github.com/pydata/sparse.git" test-command = "SPARSE_BACKEND=\"MLIR\" python -m pytest --pyargs sparse.mlir_backend"