Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions docs/how-to/environment/select-installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ tool = ["uv", "pip"]
[tool.hatch.envs.example.overrides]
matrix.tool.installer = { value = "{matrix:tool}" }
matrix.tool.scripts = [
{ key = "pip", value = "{env:HATCH_UV} pip {args}", if = ["uv"] },
{ key = "pip", value = "'{env:HATCH_UV}' pip {args}", if = ["uv"] },
]
```

Another common use case is to expose UV to all [test environments](../../config/internal/testing.md). In this case, you often wouldn't want to modify the `scripts` mapping directly but rather add an [extra script](../../config/environment/overview.md#extra-scripts):

```toml config-example
[tool.hatch.envs.hatch-test.extra-scripts]
pip = "{env:HATCH_UV} pip {args}"
pip = "'{env:HATCH_UV}' pip {args}"
```
4 changes: 2 additions & 2 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ post-install-commands = [
extra-args = ["--dist", "worksteal"]

[envs.hatch-test.extra-scripts]
pip = "{env:HATCH_UV} pip {args}"
pip = "'{env:HATCH_UV}' pip {args}"

[envs.coverage]
detached = true
Expand Down Expand Up @@ -118,7 +118,7 @@ update-hatch = [
]
update-distributions = "python scripts/update_distributions.py"
update-ruff = [
"{env:HATCH_UV} pip install --upgrade ruff",
"'{env:HATCH_UV}' pip install --upgrade ruff",
"python scripts/update_ruff.py",
]

Expand Down
1 change: 1 addition & 0 deletions tests/cli/env/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def test_default_as_json(hatch, temp_dir, config_file):
"default",
"hatch-build",
"hatch-static-analysis",
"hatch-test.py3.14",
"hatch-test.py3.13",
"hatch-test.py3.12",
"hatch-test.py3.11",
Expand Down