From 5c0d2c528bacab155dc0f4f96dd398b90be5c577 Mon Sep 17 00:00:00 2001 From: Kendell R Date: Fri, 24 Oct 2025 18:23:03 -0700 Subject: [PATCH 1/4] tweak build dependency hint wording --- crates/uv-build-frontend/src/error.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/uv-build-frontend/src/error.rs b/crates/uv-build-frontend/src/error.rs index 299ce3e0085e4..a3123865991ab 100644 --- a/crates/uv-build-frontend/src/error.rs +++ b/crates/uv-build-frontend/src/error.rs @@ -169,19 +169,19 @@ fn hint_build_dependency( }; write!( f, - "This error likely indicates that `{}` depends on `{}`, but doesn't declare it as a build dependency. \ - If `{}` is a first-party package, consider adding `{}` to its `{}`. \ - Otherwise, either add it to your `pyproject.toml` under:\n\ - \n\ - [tool.uv.extra-build-dependencies]\n\ - {} = [\"{}\"]\n\ + "This error likely indicates that `{}` depends on `{}`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`:\n\ + # if {} is first-party\n\ + [build-system]\n\ + requires = [\"{}\"]\n\ + # otherwise\n\ + [tool.uv.extra-build-dependencies]\n\ + {} = [\"{}\"]\n\ \n\ or `{}` into the environment and re-run with `{}`.", display_name.cyan(), package.cyan(), package_name.cyan(), package.cyan(), - "build-system.requires".green(), table_key.cyan(), package.cyan(), format!("uv pip install {package}").green(), From 6e9a406636142e30c2dd1ce18638620a81271dec Mon Sep 17 00:00:00 2001 From: KTibow Date: Fri, 24 Oct 2025 18:51:01 -0700 Subject: [PATCH 2/4] fix tests --- crates/uv/tests/it/pip_install.rs | 21 +++++++++++++++------ crates/uv/tests/it/sync.rs | 28 ++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/crates/uv/tests/it/pip_install.rs b/crates/uv/tests/it/pip_install.rs index d2b3a2a49151a..fc9926b33771f 100644 --- a/crates/uv/tests/it/pip_install.rs +++ b/crates/uv/tests/it/pip_install.rs @@ -5005,8 +5005,11 @@ fn no_build_isolation() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'setuptools' - hint: This error likely indicates that `anyio` depends on `setuptools`, but doesn't declare it as a build dependency. If `anyio` is a first-party package, consider adding `setuptools` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `anyio` depends on `setuptools`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if anyio is first-party + [build-system] + requires = ["setuptools"] + # otherwise [tool.uv.extra-build-dependencies] anyio = ["setuptools"] @@ -5078,8 +5081,11 @@ fn respect_no_build_isolation_env_var() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'setuptools' - hint: This error likely indicates that `anyio` depends on `setuptools`, but doesn't declare it as a build dependency. If `anyio` is a first-party package, consider adding `setuptools` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `anyio` depends on `setuptools`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if anyio is first-party + [build-system] + requires = ["setuptools"] + # otherwise [tool.uv.extra-build-dependencies] anyio = ["setuptools"] @@ -8716,8 +8722,11 @@ fn install_build_isolation_package() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'hatchling' - hint: This error likely indicates that `iniconfig` depends on `hatchling`, but doesn't declare it as a build dependency. If `iniconfig` is a first-party package, consider adding `hatchling` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `iniconfig` depends on `hatchling`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if iniconfig is first-party + [build-system] + requires = ["hatchling"] + # otherwise [tool.uv.extra-build-dependencies] iniconfig = ["hatchling"] diff --git a/crates/uv/tests/it/sync.rs b/crates/uv/tests/it/sync.rs index 566011a9eb826..bab35c2c34b44 100644 --- a/crates/uv/tests/it/sync.rs +++ b/crates/uv/tests/it/sync.rs @@ -1409,8 +1409,11 @@ fn sync_build_isolation_package() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'hatchling' - hint: This error likely indicates that `source-distribution` depends on `hatchling`, but doesn't declare it as a build dependency. If `source-distribution` is a first-party package, consider adding `hatchling` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `source-distribution` depends on `hatchling`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if source-distribution is first-party + [build-system] + requires = ["hatchling"] + # otherwise [tool.uv.extra-build-dependencies] source-distribution = ["hatchling"] @@ -1497,8 +1500,11 @@ fn sync_build_isolation_package_order() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'hatchling' - hint: This error likely indicates that `source-distribution` depends on `hatchling`, but doesn't declare it as a build dependency. If `source-distribution` is a first-party package, consider adding `hatchling` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `source-distribution` depends on `hatchling`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if source-distribution is first-party + [build-system] + requires = ["hatchling"] + # otherwise [tool.uv.extra-build-dependencies] source-distribution = ["hatchling"] @@ -1667,8 +1673,11 @@ fn sync_build_isolation_extra() -> Result<()> { File "", line 8, in ModuleNotFoundError: No module named 'hatchling' - hint: This error likely indicates that `source-distribution` depends on `hatchling`, but doesn't declare it as a build dependency. If `source-distribution` is a first-party package, consider adding `hatchling` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `source-distribution` depends on `hatchling`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if source-distribution is first-party + [build-system] + requires = ["hatchling"] + # otherwise [tool.uv.extra-build-dependencies] source-distribution = ["hatchling"] @@ -2567,8 +2576,11 @@ fn sync_build_dependencies_module_error_hints() -> Result<()> { import anyio ModuleNotFoundError: No module named 'anyio' - hint: This error likely indicates that `child@0.1.0` depends on `anyio`, but doesn't declare it as a build dependency. If `child` is a first-party package, consider adding `anyio` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `child@0.1.0` depends on `anyio`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if child is first-party + [build-system] + requires = ["anyio"] + # otherwise [tool.uv.extra-build-dependencies] child = ["anyio"] From 9903119dd8ea153edaadeabe347356ebb2208ebc Mon Sep 17 00:00:00 2001 From: KTibow Date: Fri, 24 Oct 2025 19:02:58 -0700 Subject: [PATCH 3/4] full fix --- crates/uv/tests/it/sync.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/uv/tests/it/sync.rs b/crates/uv/tests/it/sync.rs index bab35c2c34b44..3279eecee20a3 100644 --- a/crates/uv/tests/it/sync.rs +++ b/crates/uv/tests/it/sync.rs @@ -2647,8 +2647,11 @@ fn sync_build_dependencies_module_error_hints() -> Result<()> { import sklearn ModuleNotFoundError: No module named 'sklearn' - hint: This error likely indicates that `child@0.1.0` depends on `scikit-learn`, but doesn't declare it as a build dependency. If `child` is a first-party package, consider adding `scikit-learn` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `child@0.1.0` depends on `scikit-learn`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if child is first-party + [build-system] + requires = ["scikit-learn"] + # otherwise [tool.uv.extra-build-dependencies] child = ["scikit-learn"] From c5ddc622caac8d38b1e4dada9031518686aa6167 Mon Sep 17 00:00:00 2001 From: KTibow Date: Fri, 24 Oct 2025 19:16:01 -0700 Subject: [PATCH 4/4] one last(?) fix --- crates/uv-build-frontend/src/error.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/uv-build-frontend/src/error.rs b/crates/uv-build-frontend/src/error.rs index a3123865991ab..430a43a211c89 100644 --- a/crates/uv-build-frontend/src/error.rs +++ b/crates/uv-build-frontend/src/error.rs @@ -630,8 +630,11 @@ mod test { error: invalid command 'bdist_wheel' - hint: This error likely indicates that `pygraphviz-1.11` depends on `wheel`, but doesn't declare it as a build dependency. If `pygraphviz-1.11` is a first-party package, consider adding `wheel` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: - + hint: This error likely indicates that `pygraphviz-1.11` depends on `wheel`, but doesn't declare it as a build dependency. You likely should tweak your `pyproject.toml`: + # if pygraphviz-1.11 is first-party + [build-system] + requires = ["wheel"] + # otherwise [tool.uv.extra-build-dependencies] "pygraphviz-1.11" = ["wheel"]