Skip to content

fix: tolerate absolute interpreter paths for lock update - #4384

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
tyler-yankee:fix-uv-lock-path
Oct 30, 2026
Merged

rickeylev merged 1 commit into
bazel-contrib:mainfrom
tyler-yankee:fix-uv-lock-path

Conversation

@tyler-yankee

Copy link
Copy Markdown
Contributor

Since #4029, the lock macro defaults the directory to the package name, and attempts to resolve the path to the Python interpreter via relative path after uv changes into that directory. This is fine for hermetic Python, but it doesn't respect the case that interpreter_path is absolute.

If we have an absolute path to an interpreter, it doesn't need to involve --directory, so avoid the prefix altogether.

Since commit 2d39a20 (feat(uv): add --directory support for locking
(bazel-contrib#4029), 2026-09-02), the `lock` macro defaults the `directory` to the
package name, and attempts to resolve the path to the Python
interpreter via relative path after `uv` changes into that directory.
This is fine for hermetic Python, but it doesn't respect the case that
`interpreter_path` is absolute.

If we have an absolute path to an interpreter, it doesn't need to
involve `--directory`, so avoid the prefix altogether.

@rickeylev rickeylev left a comment

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.

Thanks for the fix!

@rickeylev
rickeylev added this pull request to the merge queue Oct 30, 2026
Merged via the queue into bazel-contrib:main with commit 6b85867 Oct 30, 2026
13 checks passed
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