diff --git a/crates/uv/src/commands/project/init.rs b/crates/uv/src/commands/project/init.rs index 794bafc759fa5..654d95519873d 100644 --- a/crates/uv/src/commands/project/init.rs +++ b/crates/uv/src/commands/project/init.rs @@ -989,6 +989,9 @@ fn pyproject_build_system(package: &PackageName, build_backend: ProjectBuildBack python-packages = ["{module_name}"] python-source = "src" + [tool.uv] + cache-keys = [{{ file = "pyproject.toml" }}, {{ file = "src/**/*.rs" }}, {{ file = "Cargo.toml" }}, {{ file = "Cargo.lock" }}] + [build-system] requires = ["maturin>=1.0,<2.0"] build-backend = "maturin" @@ -998,6 +1001,9 @@ fn pyproject_build_system(package: &PackageName, build_backend: ProjectBuildBack minimum-version = "build-system.requires" build-dir = "build/{wheel_tag}" + [tool.uv] + cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.{h,c,hpp,cpp}" }, { file = "CMakeLists.txt" }] + [build-system] requires = ["scikit-build-core>=0.10", "pybind11"] build-backend = "scikit_build_core.build" diff --git a/crates/uv/tests/it/init.rs b/crates/uv/tests/it/init.rs index 3f374eada3ee6..c106978c14b6d 100644 --- a/crates/uv/tests/it/init.rs +++ b/crates/uv/tests/it/init.rs @@ -3279,6 +3279,9 @@ fn init_app_build_backend_maturin() -> Result<()> { python-packages = ["foo"] python-source = "src" + [tool.uv] + cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.rs" }, { file = "Cargo.toml" }, { file = "Cargo.lock" }] + [build-system] requires = ["maturin>=1.0,<2.0"] build-backend = "maturin" @@ -3408,6 +3411,9 @@ fn init_app_build_backend_scikit() -> Result<()> { minimum-version = "build-system.requires" build-dir = "build/{wheel_tag}" + [tool.uv] + cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.{h,c,hpp,cpp}" }, { file = "CMakeLists.txt" }] + [build-system] requires = ["scikit-build-core>=0.10", "pybind11"] build-backend = "scikit_build_core.build" @@ -3530,6 +3536,9 @@ fn init_lib_build_backend_maturin() -> Result<()> { python-packages = ["foo"] python-source = "src" + [tool.uv] + cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.rs" }, { file = "Cargo.toml" }, { file = "Cargo.lock" }] + [build-system] requires = ["maturin>=1.0,<2.0"] build-backend = "maturin" @@ -3656,6 +3665,9 @@ fn init_lib_build_backend_scikit() -> Result<()> { minimum-version = "build-system.requires" build-dir = "build/{wheel_tag}" + [tool.uv] + cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.{h,c,hpp,cpp}" }, { file = "CMakeLists.txt" }] + [build-system] requires = ["scikit-build-core>=0.10", "pybind11"] build-backend = "scikit_build_core.build"