diff --git a/crates/uv/src/commands/project/init.rs b/crates/uv/src/commands/project/init.rs index 794bafc75..654d95519 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 2a8c2509a..39b2dc712 100644 --- a/crates/uv/tests/it/init.rs +++ b/crates/uv/tests/it/init.rs @@ -3322,6 +3322,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" @@ -3451,6 +3454,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" @@ -3573,6 +3579,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" @@ -3699,6 +3708,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"