Skip to content

Commit 3440572

Browse files
authored
docs: Explain why the lock rule has no implicit test target (#3411)
Fixes #3400
1 parent 7c6b109 commit 3440572

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/uv/lock.bzl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ Differences with the legacy {obj}`compile_pip_requirements` rule:
2121
- This does not error out if the output file does not exist yet.
2222
- Supports transitions out of the box.
2323
24-
Note, this does not provide a `test` target, if you would like to add a test
25-
target that always does the locking automatically to ensure that the
24+
Note, this does not provide a test target like {obj}`compile_pip_requirements` does.
25+
The `uv pip compile` command is not hermetic and thus a test based on it would most likely be flaky:
26+
- It may require auth injected into it, so most likely it requires a local tag added so that the bazel action runs without sandboxing.
27+
- It requires network access.
28+
29+
Given those points, a test target should be an explicit and properly documented target and not a hidden implicit target.
30+
If, you would like to add a test target that always does the locking automatically to ensure that the
2631
`requirements.txt` file is up-to-date, add something similar to:
2732
2833
```starlark

0 commit comments

Comments
 (0)