build: move requirements update multirun from //private to //dev (#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 #4128
diff --git a/dev/BUILD.bazel b/dev/BUILD.bazel
index 22fe5bb..9b0e32b 100644
--- a/dev/BUILD.bazel
+++ b/dev/BUILD.bazel
@@ -1,3 +1,4 @@
+load("@rules_multirun//:defs.bzl", "multirun")
load("//python/uv:lock.bzl", "lock") # buildifier: disable=bzl-visibility
licenses(["notice"])
@@ -27,3 +28,51 @@
python_version = "3.10",
visibility = ["//:__subpackages__"],
)
+
+# This target runs all dev-only dependency updaters across the repo.
+# Run: bazel run //dev:all_requirements.update
+multirun(
+ name = "all_requirements.update",
+ commands = [
+ "//tools/publish:{}.update".format(r)
+ for r in [
+ "requirements_universal",
+ "requirements_darwin",
+ "requirements_windows",
+ "requirements_linux",
+ ]
+ ] + [
+ ":requirements.update",
+ ":uv_lock.update",
+ "//examples:bzlmod_requirements_3_12.update",
+ "//examples:bzlmod_requirements_3_12_windows.update",
+ "//examples:bzlmod_requirements_3_13.update",
+ "//examples:bzlmod_requirements_3_13_windows.update",
+ "//examples:bzlmod_requirements_3_14.update",
+ "//examples:bzlmod_requirements_3_14_windows.update",
+ "//tests/multi_pypi/alpha:requirements.update",
+ "//tests/multi_pypi/beta:requirements.update",
+ "//tests/uv/lock/pyproject_toml:requirements.update",
+ "//tests/uv/lock/workspaces:requirements.update",
+ ],
+ tags = ["manual"],
+ visibility = ["//:__subpackages__"],
+)
+
+alias(
+ name = "requirements_all.update",
+ actual = ":all_requirements.update",
+ tags = ["manual"],
+ visibility = ["//:__subpackages__"],
+)
+
+# NOTE: The requirements for the pip dependencies may sometimes break the build
+# process due to how `pip-compile` works (i.e. it sometimes needs to build
+# wheels to resolve the `pyproject.toml` file. Hence we do not lump the
+# target with the other targets above.
+alias(
+ name = "whl_library_requirements.update",
+ actual = "//tools/private/update_deps:update_pip_deps",
+ tags = ["manual"],
+ visibility = ["//:__subpackages__"],
+)
diff --git a/docs/devguide.md b/docs/devguide.md
index b886e81..f8445ae 100644
--- a/docs/devguide.md
+++ b/docs/devguide.md
@@ -95,11 +95,11 @@
1. Modify the `./python/private/pypi/requirements.txt` file and run:
```
- bazel run //private:whl_library_requirements.update
+ bazel run //dev:whl_library_requirements.update
```
1. Run the following target to update `twine` dependencies:
```
- bazel run //private:requirements.update
+ bazel run //dev:all_requirements.update
```
1. Bump the coverage dependencies using the script using:
```
@@ -111,11 +111,11 @@
## Updating tool dependencies
It's suggested to routinely update the tool versions within our repo. Some of the
-tools are using requirement files compiled by `uv`, and others use other means. In order
-to have everything self-documented, we have a special target,
-`//private:requirements.update`, which uses `rules_multirun` to run all
-of the requirement-updating scripts in sequence in one go. This can be done once per release as
-we prepare for releases.
+tools are using requirement files compiled by `uv`, and others use other means.
+In order to have everything self-documented, we have a special target,
+`//dev:all_requirements.update`, which uses `rules_multirun` to run all of the
+requirement-updating scripts in sequence in one go. This can be done once per
+release as we prepare for releases.
(creating-backport-prs)=
## Creating Backport PRs
diff --git a/private/BUILD.bazel b/private/BUILD.bazel
deleted file mode 100644
index 761298f..0000000
--- a/private/BUILD.bazel
+++ /dev/null
@@ -1,40 +0,0 @@
-load("@rules_multirun//:defs.bzl", "multirun")
-
-# This file has various targets that are using dev-only dependencies that our users should not ideally see.
-
-multirun(
- name = "requirements.update",
- commands = [
- "//tools/publish:{}.update".format(r)
- for r in [
- "requirements_universal",
- "requirements_darwin",
- "requirements_windows",
- "requirements_linux",
- ]
- ] + [
- "//dev:requirements.update",
- "//dev:uv_lock.update",
- "//examples:bzlmod_requirements_3_12.update",
- "//examples:bzlmod_requirements_3_12_windows.update",
- "//examples:bzlmod_requirements_3_13.update",
- "//examples:bzlmod_requirements_3_13_windows.update",
- "//examples:bzlmod_requirements_3_14.update",
- "//examples:bzlmod_requirements_3_14_windows.update",
- "//tests/multi_pypi/alpha:requirements.update",
- "//tests/multi_pypi/beta:requirements.update",
- "//tests/uv/lock/pyproject_toml:requirements.update",
- "//tests/uv/lock/workspaces:requirements.update",
- ],
- tags = ["manual"],
-)
-
-# NOTE: The requirements for the pip dependencies may sometimes break the build
-# process due to how `pip-compile` works (i.e. it sometimes needs to build
-# wheels to resolve the `pyproject.toml` file. Hence we do not lump the
-# target with the other targets above.
-alias(
- name = "whl_library_requirements.update",
- actual = "//tools/private/update_deps:update_pip_deps",
- tags = ["manual"],
-)
diff --git a/tools/private/update_deps/BUILD.bazel b/tools/private/update_deps/BUILD.bazel
index 8746d82..5ebb855 100644
--- a/tools/private/update_deps/BUILD.bazel
+++ b/tools/private/update_deps/BUILD.bazel
@@ -59,7 +59,7 @@
"REQUIREMENTS_TXT": "$(rlocationpath //python/private/pypi:requirements_txt)",
},
imports = ["../../.."],
- visibility = ["//private:__pkg__"],
+ visibility = ["//:__subpackages__"],
deps = [
":args",
":update_file",
diff --git a/tools/publish/BUILD.bazel b/tools/publish/BUILD.bazel
index a449405..93b44b3 100644
--- a/tools/publish/BUILD.bazel
+++ b/tools/publish/BUILD.bazel
@@ -38,5 +38,5 @@
"--emit-index-url",
"--upgrade", # always upgrade
],
- visibility = ["//private:__pkg__"],
+ visibility = ["//:__subpackages__"],
)