Skip to content

Commit 3ad6cb4

Browse files
authored
fix(uv): make uv lock rule work with platform python runtime (#3303)
A platform runtime is when the interpreter is provided as an absolute path to Python instead of bundled in the runfiles. The uv lock rule almost worked, it just didn't handle the runtime files being empty in such a case. To fix, use an empty depset to satisfy the subsequent APIs that use it.
1 parent 08bd451 commit 3ad6cb4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ END_UNRELEASED_TEMPLATE
8282
* (venvs) {obj}`--venvs_site_packages=yes` no longer errors when packages with
8383
overlapping files or directories are used together.
8484
([#3204](https://github.com/bazel-contrib/rules_python/issues/3204)).
85+
* (uv) {obj}`//python/uv:lock.bzl%lock` now works with a local platform
86+
runtime.
8587

8688
{#v0-0-0-added}
8789
### Added

python/uv/private/lock.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _lock_impl(ctx):
106106
exec_tools = ctx.toolchains[EXEC_TOOLS_TOOLCHAIN_TYPE].exec_tools
107107
runtime = exec_tools.exec_interpreter[platform_common.ToolchainInfo].py3_runtime
108108
python = runtime.interpreter or runtime.interpreter_path
109-
python_files = runtime.files
109+
python_files = runtime.files or depset()
110110
args.add("--python", python)
111111
args.add_all(srcs)
112112

0 commit comments

Comments
 (0)