Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
bb38665
refactor(pypi): migrate requirements.txt lockfiles to uv.lock
rickeylev Oct 29, 2026
1f9fda5
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
bf75e79
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
af78f37
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
d8b8ecf
refactor(pypi): update vendored requirements.bzl for Bazel wheel down…
rickeylev Oct 31, 2026
68987ba
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
4a74177
refactor(pypi): vendor cross-platform wheel map in examples/pip_parse…
rickeylev Oct 31, 2026
64f4e60
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
aae1ab0
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
052647e
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
2cd4a71
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
d8426b7
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
528875c
chore(examples): keep pip_parse_vendored on legacy pip_parse and sync…
rickeylev Oct 31, 2026
09cb668
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
99cf38e
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
d8bbee1
fix(publish): use hub alias label @rules_python_publish_deps//twine:p…
rickeylev Oct 31, 2026
690f392
Merge branch 'use_uv_lock_rule' into migrate_to_uv_lock
rickeylev Oct 31, 2026
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
2 changes: 1 addition & 1 deletion .github/actions/setup-bazel/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
repository-cache: |
- MODULE.bazel
- dev/uv.lock
- tools/publish/requirements_linux.txt
- tools/publish/uv.lock
bazelrc: |
# .bazelrc enables --config=pyrefly by default; disable the pyrefly
# output group here so operational workflows don't download the
Expand Down
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ When modifying locked/resolved requirements files:

When updating the minimum Python version for dev/docs tooling (e.g. following
Dependabot alerts):
* Update `python_version` in both `lock(name = "requirements", ...)` and
`lock(name = "uv_lock", ...)` within `dev/BUILD.bazel`.
* Regenerate lockfiles by running:
`bazel run //dev:requirements.update && bazel run //dev:uv_lock.update`
* Update `python_version` in `lock(name = "uv_lock", ...)` within
`dev/BUILD.bazel`.
* Regenerate the lockfile by running:
`bazel run //dev:uv_lock.update`
* Verify docs build via `bazel build //docs:docs`.

## rules_python idiosyncrasies
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ Some miscellanous style, idioms, and conventions we have are:
Some checked-in files are generated and need to be updated when a new PR is
merged:

* **requirements lock files**: These are usually generated by a
`compile_pip_requirements` update target, which is usually in the same directory.
e.g. `bazel run //dev:requirements.update`
* **requirements lock files**: These are usually generated by a `lock` update
target, which is usually in the same directory. e.g.
`bazel run //dev:uv_lock.update`

## Binary artifacts

Expand Down
12 changes: 4 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ pip = use_extension("//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "rules_python_publish_deps",
python_version = "3.14",
requirements_by_platform = {
"//tools/publish:requirements_darwin.txt": "osx_*",
"//tools/publish:requirements_linux.txt": "linux_*",
"//tools/publish:requirements_windows.txt": "windows_*",
},
target_platforms = [
"linux_aarch64",
"linux_x86_64",
Expand All @@ -93,6 +88,7 @@ pip.parse(
"windows_aarch64",
"windows_x86_64",
],
uv_lock = "//tools/publish:uv.lock",
)
pip.dep(name = "pytest")
pip.dep(name = "pytest-bazel")
Expand Down Expand Up @@ -403,17 +399,17 @@ dev_pip.parse(
download_only = True,
hub_name = "pypiserver",
python_version = "3.14",
requirements_lock = "//examples/wheel:requirements_server.txt",
uv_lock = "//examples/wheel:uv.lock",
)
dev_pip.parse(
hub_name = "pypi_alpha",
python_version = "3.14",
requirements_lock = "//tests/multi_pypi/alpha:requirements.txt",
uv_lock = "//tests/multi_pypi/alpha:uv.lock",
)
dev_pip.parse(
hub_name = "pypi_beta",
python_version = "3.14",
requirements_lock = "//tests/multi_pypi/beta:requirements.txt",
uv_lock = "//tests/multi_pypi/beta:uv.lock",
)
use_repo(dev_pip, "dev_pip", "pypi_alpha", "pypi_beta", "pypiserver")

Expand Down
24 changes: 11 additions & 13 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,22 @@ interpreter = "@python_3_14_4_host//:python"
# Install twine for our own runfiles wheel publishing.
# Eventually we might want to install twine automatically for users too, see:
# https://github.com/bazel-contrib/rules_python/issues/1016.
load("@rules_python//python:pip.bzl", "pip_parse")
load("@rules_python//python:pip.bzl", "uv_lock")

pip_parse(
uv_lock(
name = "rules_python_publish_deps",
python_interpreter_target = interpreter,
requirements_darwin = "//tools/publish:requirements_darwin.txt",
requirements_lock = "//tools/publish:requirements_linux.txt",
requirements_windows = "//tools/publish:requirements_windows.txt",
uv_lock = "//tools/publish:uv.lock",
)

load("@rules_python_publish_deps//:requirements.bzl", "install_deps")

install_deps()

pip_parse(
uv_lock(
name = "pypiserver",
python_interpreter_target = interpreter,
requirements_lock = "//examples/wheel:requirements_server.txt",
uv_lock = "//examples/wheel:uv.lock",
)

load("@pypiserver//:requirements.bzl", install_pypiserver = "install_deps", pypiserver_requirements = "all_requirements")
Expand All @@ -153,10 +151,10 @@ install_pypiserver()
#####################
# Install dev dependencies.

pip_parse(
uv_lock(
name = "dev_pip",
python_interpreter_target = interpreter,
requirements_lock = "//dev:requirements.txt",
uv_lock = "//dev:uv.lock",
)

load("@dev_pip//:requirements.bzl", dev_pip_requirements = "all_requirements", docs_install_deps = "install_deps")
Expand All @@ -166,20 +164,20 @@ docs_install_deps()
#####################
# Pypi repos for //tests/multi_pypi

pip_parse(
uv_lock(
name = "pypi_alpha",
python_interpreter_target = interpreter,
requirements_lock = "//tests/multi_pypi/alpha:requirements.txt",
uv_lock = "//tests/multi_pypi/alpha:uv.lock",
)

load("@pypi_alpha//:requirements.bzl", pypi_alpha_install_deps = "install_deps", pypi_alpha_requirements = "all_requirements")

pypi_alpha_install_deps()

pip_parse(
uv_lock(
name = "pypi_beta",
python_interpreter_target = interpreter,
requirements_lock = "//tests/multi_pypi/beta:requirements.txt",
uv_lock = "//tests/multi_pypi/beta:uv.lock",
)

load("@pypi_beta//:requirements.bzl", pypi_beta_install_deps = "install_deps", pypi_beta_requirements = "all_requirements")
Expand Down
28 changes: 1 addition & 27 deletions dev/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,6 @@ load("//python/uv:lock.bzl", "lock") # buildifier: disable=bzl-visibility

licenses(["notice"])

# Only present for WORKSPACE support; bzlmod uses //dev:uv.lock.
# Run bazel run //dev:requirements.update
lock(
name = "requirements",
srcs = ["pyproject.toml"],
out = "requirements.txt",
args = [
"--emit-index-url",
"--universal",
"--upgrade",
],
# NOTE @aignas 2025-08-17: here we select the lowest actively supported
# version so that the requirements file is generated to be compatible with
# Python version 3.10 or greater.
python_version = "3.10",
visibility = ["//:__subpackages__"],
)

# Run bazel run //dev:uv_lock.update
lock(
name = "uv_lock",
Expand All @@ -35,15 +17,6 @@ lock(
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_other_module_uv_lock.update",
"//examples:bzlmod_uv_lock.update",
Expand All @@ -55,6 +28,7 @@ multirun(
"//tests/multiple_inputs:multiple_requirements_in.update",
"//tests/uv/lock/pyproject_toml:requirements.update",
"//tests/uv/lock/workspaces:requirements.update",
"//tools/publish:requirements.update",
],
tags = ["manual"],
visibility = ["//:__subpackages__"],
Expand Down
Loading
Loading