Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/uv/src/commands/project/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "requirements.txt" }}, {{ file = "src/**/*.rs" }}, {{ file = "Cargo.toml" }}, {{ file = "Cargo.lock" }}]

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
Expand All @@ -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 = "requirements.txt" }, { file = "src/**/*.cpp" }, { file = "src/**/*.h" }, { file = "CMakeLists.txt" }]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need the double {{ and }} here also?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that at present, the Scikit project string does not use format! like the Maturin project string does. As a result, {wheel_tag} is still present in the resulting pyproject.toml. I'll have to investigate why this even works.

@henryiii henryiii Sep 10, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, scikit-build-core has to inject the wheel tag there when it builds, since you don't know the wheel tag before you start building a wheel. You want {wheel_tag} in the pyproject.toml.


[build-system]
requires = ["scikit-build-core>=0.10", "pybind11"]
build-backend = "scikit_build_core.build"
Expand Down
12 changes: 12 additions & 0 deletions crates/uv/tests/it/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "requirements.txt" }, { file = "src/**/*.rs" }, { file = "Cargo.toml" }, { file = "Cargo.lock" }]

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
Expand Down Expand Up @@ -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 = "requirements.txt" }, { file = "src/**/*.cpp" }, { file = "src/**/*.h" }, { file = "CMakeLists.txt" }]

[build-system]
requires = ["scikit-build-core>=0.10", "pybind11"]
build-backend = "scikit_build_core.build"
Expand Down Expand Up @@ -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 = "requirements.txt" }, { file = "src/**/*.rs" }, { file = "Cargo.toml" }, { file = "Cargo.lock" }]

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
Expand Down Expand Up @@ -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 = "requirements.txt" }, { file = "src/**/*.cpp" }, { file = "src/**/*.h" }, { file = "CMakeLists.txt" }]

[build-system]
requires = ["scikit-build-core>=0.10", "pybind11"]
build-backend = "scikit_build_core.build"
Expand Down
Loading