Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
21 changes: 12 additions & 9 deletions crates/uv-build-frontend/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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"]

Expand Down
21 changes: 15 additions & 6 deletions crates/uv/tests/it/pip_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5005,8 +5005,11 @@ fn no_build_isolation() -> Result<()> {
File "<string>", line 8, in <module>
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"]

Expand Down Expand Up @@ -5078,8 +5081,11 @@ fn respect_no_build_isolation_env_var() -> Result<()> {
File "<string>", line 8, in <module>
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"]

Expand Down Expand Up @@ -8716,8 +8722,11 @@ fn install_build_isolation_package() -> Result<()> {
File "<string>", line 8, in <module>
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"]

Expand Down
35 changes: 25 additions & 10 deletions crates/uv/tests/it/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,11 @@ fn sync_build_isolation_package() -> Result<()> {
File "<string>", line 8, in <module>
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"]

Expand Down Expand Up @@ -1497,8 +1500,11 @@ fn sync_build_isolation_package_order() -> Result<()> {
File "<string>", line 8, in <module>
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"]

Expand Down Expand Up @@ -1667,8 +1673,11 @@ fn sync_build_isolation_extra() -> Result<()> {
File "<string>", line 8, in <module>
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"]

Expand Down Expand Up @@ -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 `[email protected]` 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 `[email protected]` 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"]

Expand Down Expand Up @@ -2635,8 +2647,11 @@ fn sync_build_dependencies_module_error_hints() -> Result<()> {
import sklearn
ModuleNotFoundError: No module named 'sklearn'

hint: This error likely indicates that `[email protected]` 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 `[email protected]` 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"]

Expand Down
Loading