Skip to content

Commit ed7b3d2

Browse files
authored
Merge pull request #1 from astral-sh/main
Better defaults for native build backend cache keys (astral-sh#15705)
2 parents 21a92c1 + 3081557 commit ed7b3d2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

crates/uv/src/commands/project/init.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,9 @@ fn pyproject_build_system(package: &PackageName, build_backend: ProjectBuildBack
989989
python-packages = ["{module_name}"]
990990
python-source = "src"
991991
992+
[tool.uv]
993+
cache-keys = [{{ file = "pyproject.toml" }}, {{ file = "src/**/*.rs" }}, {{ file = "Cargo.toml" }}, {{ file = "Cargo.lock" }}]
994+
992995
[build-system]
993996
requires = ["maturin>=1.0,<2.0"]
994997
build-backend = "maturin"
@@ -998,6 +1001,9 @@ fn pyproject_build_system(package: &PackageName, build_backend: ProjectBuildBack
9981001
minimum-version = "build-system.requires"
9991002
build-dir = "build/{wheel_tag}"
10001003
1004+
[tool.uv]
1005+
cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.{h,c,hpp,cpp}" }, { file = "CMakeLists.txt" }]
1006+
10011007
[build-system]
10021008
requires = ["scikit-build-core>=0.10", "pybind11"]
10031009
build-backend = "scikit_build_core.build"

crates/uv/tests/it/init.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3322,6 +3322,9 @@ fn init_app_build_backend_maturin() -> Result<()> {
33223322
python-packages = ["foo"]
33233323
python-source = "src"
33243324
3325+
[tool.uv]
3326+
cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.rs" }, { file = "Cargo.toml" }, { file = "Cargo.lock" }]
3327+
33253328
[build-system]
33263329
requires = ["maturin>=1.0,<2.0"]
33273330
build-backend = "maturin"
@@ -3451,6 +3454,9 @@ fn init_app_build_backend_scikit() -> Result<()> {
34513454
minimum-version = "build-system.requires"
34523455
build-dir = "build/{wheel_tag}"
34533456
3457+
[tool.uv]
3458+
cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.{h,c,hpp,cpp}" }, { file = "CMakeLists.txt" }]
3459+
34543460
[build-system]
34553461
requires = ["scikit-build-core>=0.10", "pybind11"]
34563462
build-backend = "scikit_build_core.build"
@@ -3573,6 +3579,9 @@ fn init_lib_build_backend_maturin() -> Result<()> {
35733579
python-packages = ["foo"]
35743580
python-source = "src"
35753581
3582+
[tool.uv]
3583+
cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.rs" }, { file = "Cargo.toml" }, { file = "Cargo.lock" }]
3584+
35763585
[build-system]
35773586
requires = ["maturin>=1.0,<2.0"]
35783587
build-backend = "maturin"
@@ -3699,6 +3708,9 @@ fn init_lib_build_backend_scikit() -> Result<()> {
36993708
minimum-version = "build-system.requires"
37003709
build-dir = "build/{wheel_tag}"
37013710
3711+
[tool.uv]
3712+
cache-keys = [{ file = "pyproject.toml" }, { file = "src/**/*.{h,c,hpp,cpp}" }, { file = "CMakeLists.txt" }]
3713+
37023714
[build-system]
37033715
requires = ["scikit-build-core>=0.10", "pybind11"]
37043716
build-backend = "scikit_build_core.build"

0 commit comments

Comments
 (0)