Skip to content

Commit 88e1253

Browse files
authored
build: move requirements update multirun from //private to //dev (bazel-contrib#4143)
Part of consolidating developer-only tools and utilities under //dev. Top-level //private ambiguously conflates rule internals with developer utilities. Move the repo-wide requirements update multirun from //private to //dev:all_requirements.update and remove the //private package. Work towards bazel-contrib#4128
1 parent 6db21fa commit 88e1253

5 files changed

Lines changed: 58 additions & 49 deletions

File tree

‎dev/BUILD.bazel‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_multirun//:defs.bzl", "multirun")
12
load("//python/uv:lock.bzl", "lock") # buildifier: disable=bzl-visibility
23

34
licenses(["notice"])
@@ -27,3 +28,51 @@ lock(
2728
python_version = "3.10",
2829
visibility = ["//:__subpackages__"],
2930
)
31+
32+
# This target runs all dev-only dependency updaters across the repo.
33+
# Run: bazel run //dev:all_requirements.update
34+
multirun(
35+
name = "all_requirements.update",
36+
commands = [
37+
"//tools/publish:{}.update".format(r)
38+
for r in [
39+
"requirements_universal",
40+
"requirements_darwin",
41+
"requirements_windows",
42+
"requirements_linux",
43+
]
44+
] + [
45+
":requirements.update",
46+
":uv_lock.update",
47+
"//examples:bzlmod_requirements_3_12.update",
48+
"//examples:bzlmod_requirements_3_12_windows.update",
49+
"//examples:bzlmod_requirements_3_13.update",
50+
"//examples:bzlmod_requirements_3_13_windows.update",
51+
"//examples:bzlmod_requirements_3_14.update",
52+
"//examples:bzlmod_requirements_3_14_windows.update",
53+
"//tests/multi_pypi/alpha:requirements.update",
54+
"//tests/multi_pypi/beta:requirements.update",
55+
"//tests/uv/lock/pyproject_toml:requirements.update",
56+
"//tests/uv/lock/workspaces:requirements.update",
57+
],
58+
tags = ["manual"],
59+
visibility = ["//:__subpackages__"],
60+
)
61+
62+
alias(
63+
name = "requirements_all.update",
64+
actual = ":all_requirements.update",
65+
tags = ["manual"],
66+
visibility = ["//:__subpackages__"],
67+
)
68+
69+
# NOTE: The requirements for the pip dependencies may sometimes break the build
70+
# process due to how `pip-compile` works (i.e. it sometimes needs to build
71+
# wheels to resolve the `pyproject.toml` file. Hence we do not lump the
72+
# target with the other targets above.
73+
alias(
74+
name = "whl_library_requirements.update",
75+
actual = "//tools/private/update_deps:update_pip_deps",
76+
tags = ["manual"],
77+
visibility = ["//:__subpackages__"],
78+
)

‎docs/devguide.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ integration test.
9595

9696
1. Modify the `./python/private/pypi/requirements.txt` file and run:
9797
```
98-
bazel run //private:whl_library_requirements.update
98+
bazel run //dev:whl_library_requirements.update
9999
```
100100
1. Run the following target to update `twine` dependencies:
101101
```
102-
bazel run //private:requirements.update
102+
bazel run //dev:all_requirements.update
103103
```
104104
1. Bump the coverage dependencies using the script using:
105105
```
@@ -111,11 +111,11 @@ integration test.
111111
## Updating tool dependencies
112112

113113
It's suggested to routinely update the tool versions within our repo. Some of the
114-
tools are using requirement files compiled by `uv`, and others use other means. In order
115-
to have everything self-documented, we have a special target,
116-
`//private:requirements.update`, which uses `rules_multirun` to run all
117-
of the requirement-updating scripts in sequence in one go. This can be done once per release as
118-
we prepare for releases.
114+
tools are using requirement files compiled by `uv`, and others use other means.
115+
In order to have everything self-documented, we have a special target,
116+
`//dev:all_requirements.update`, which uses `rules_multirun` to run all of the
117+
requirement-updating scripts in sequence in one go. This can be done once per
118+
release as we prepare for releases.
119119

120120
(creating-backport-prs)=
121121
## Creating Backport PRs

‎private/BUILD.bazel‎

Lines changed: 0 additions & 40 deletions
This file was deleted.

‎tools/private/update_deps/BUILD.bazel‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ py_binary(
5959
"REQUIREMENTS_TXT": "$(rlocationpath //python/private/pypi:requirements_txt)",
6060
},
6161
imports = ["../../.."],
62-
visibility = ["//private:__pkg__"],
62+
visibility = ["//:__subpackages__"],
6363
deps = [
6464
":args",
6565
":update_file",

‎tools/publish/BUILD.bazel‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ publish_deps(
3838
"--emit-index-url",
3939
"--upgrade", # always upgrade
4040
],
41-
visibility = ["//private:__pkg__"],
41+
visibility = ["//:__subpackages__"],
4242
)

0 commit comments

Comments
 (0)