Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notes about the use of UV in hatch-test #1768

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions docs/how-to/environment/dependency-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ PIP_INDEX_URL = "https://token:{env:GITLAB_API_TOKEN}@gitlab.com/api/v4/groups/<
PIP_EXTRA_INDEX_URL = "https://token:{env:GITLAB_API_TOKEN}@gitlab.com/api/v4/groups/<group2_path>/-/packages/pypi/simple/ https://pypi.org/simple/"
```

Note that Hatch's *internal* environments, such as the `hatch-test`
matrix used by the [`test` command](../../../cli/reference/#hatch-test),
now use `uv`. Therefore if you wish change their dependency
resolution behaviour, you will need to also set the corresponding
environment variables, as described below.

## UV

If you're [using UV](select-installer.md), a different set of [environment variables](https://github.com/astral-sh/uv/tree/0.1.35#environment-variables) are available to configure its behavior. The previous example would look like this instead:
Expand Down
6 changes: 6 additions & 0 deletions src/hatch/cli/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ def test(
The inclusion option is treated as an intersection while the exclusion option is treated as a
union i.e. an environment must match all of the included variables to be selected while matching
any of the excluded variables will prevent selection.
\b
!!! tip
The `hatch-test` matrix [uses UV](../../how-to/environment/select-installer) as its installer by
default. If you wish to control dependency resolution for your tests (to use a custom or extra
PyPI index for instance), you must [set its specific environment
variables](../../how-to/environment/dependency-resolution#UV)
"""
app: Application = ctx.obj

Expand Down
Loading