Skip to content

chore(examples): replace compile_pip_requirements with uv lock() - #4110

Draft
rickeylev wants to merge 7 commits into
bazel-contrib:mainfrom
rickeylev:replace_pip_with_uv
Draft

chore(examples): replace compile_pip_requirements with uv lock()#4110
rickeylev wants to merge 7 commits into
bazel-contrib:mainfrom
rickeylev:replace_pip_with_uv

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Using pip-compile via compile_pip_requirements is slower and being
superseded by uv for requirement locking under Bzlmod. Demonstrating
lock() in the examples ensures users follow modern best practices
and benefit from faster dependency resolution.

Migrate Bzlmod-enabled example workspaces and documentation to use the
lock() macro in place of compile_pip_requirements, updating the
associated requirements targets and lockfiles. Additionally,
canonicalize platform labels within lock() so submodules resolve
targets reliably.

DO NOT MERGE: consider making uv auto-used before switching everything
over to it.

Modernize requirement locking across Bzlmod-enabled examples and
documentation to use uv via the lock() rule instead of pip-compile.

Migrate requirement targets in Bzlmod examples to lock() and update
universal and Windows lockfiles. Canonicalize platform labels in lock()
so submodules resolve targets correctly.
Format multi-word flag arguments as key=value pairs (--flag=val)
for clarity.

Add DO NOT SUBMIT comment in other_module/MODULE.bazel to consider
making uv auto-used before switching all examples over to it.
Note that platform labels in lock() are canonicalized for submodules.
Move [tool.uv] settings subsection directly under uv pip compile (bzlmod)
before the pip compile (WORKSPACE) section.
Update bzlmod_lockfile MODULE.bazel.lock after canonical label
changes in common_labels.bzl and lock.bzl.
Clarify that consideration of making uv auto-used is a DO NOT MERGE
condition.
Comment on lines +44 to +45
# DO NOT MERGE: consider making uv auto-used before switching
# everything over to it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about uv not being present in WORKSPACE?

@aignas

aignas commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Do we need #4029 to be able to fully switch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants