Skip to content

Commit 4f53585

Browse files
committed
move docs
1 parent 0fe2bb4 commit 4f53585

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

python/uv/lock.bzl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,32 @@
1414

1515
"""The `uv` locking rule.
1616
17+
Differences with the legacy {obj}`compile_pip_requirements` rule:
18+
- This is implemented as a rule that performs locking in a build action.
19+
- Additionally one can use the runnable target.
20+
- Uses `uv`.
21+
- This does not error out if the output file does not exist yet.
22+
- Supports transitions out of the box.
23+
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
26+
`requirements.txt` file is up-to-date, add something similar to:
27+
28+
```starlark
29+
load("@bazel_skylib//rules:native_binary.bzl", "native_test")
30+
load("@rules_python//python/uv:lock.bzl", "lock")
31+
32+
lock(
33+
name = "requirements",
34+
srcs = ["pyproject.toml"],
35+
)
36+
37+
native_test(
38+
name = "requirements_test",
39+
src = "requirements.update",
40+
)
41+
```
42+
1743
EXPERIMENTAL: This is experimental and may be removed without notice
1844
"""
1945

python/uv/private/lock.bzl

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""A simple macro to lock the requirements.
16-
17-
Differences with the legacy {obj}`compile_pip_requirements` rule:
18-
- This is implemented as a rule that performs locking in a build action.
19-
- Additionally one can use the runnable target.
20-
- Uses `uv`.
21-
- This does not error out if the output file does not exist yet.
22-
- Supports transitions out of the box.
23-
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
26-
`requirements.txt` file is up-to-date, add something similar to:
27-
28-
```starlark
29-
load("@bazel_skylib//rules:native_binary.bzl", "native_test")
30-
load("@rules_python//python/uv:lock.bzl", "lock")
31-
32-
lock(
33-
name = "requirements",
34-
srcs = ["pyproject.toml"],
35-
)
36-
37-
native_test(
38-
name = "requirements_test",
39-
src = "requirements.update",
40-
)
41-
```
15+
"""An implementation for a simple macro to lock the requirements.
4216
"""
4317

4418
load("@bazel_skylib//lib:shell.bzl", "shell")

0 commit comments

Comments
 (0)