Support multi-platform uv bootstrap assets#3073
Conversation
Greptile SummaryThis PR replaces the hardcoded Linux x86_64 Key changes:
Confidence Score: 5/5Safe to merge; the only remaining finding is a harmless redundant shell expression that does not affect runtime behaviour. All previously raised P1 concerns (subshell exit 1, empty-dependencies invalid command) have been addressed. The single remaining comment is a copy-paste duplicate of a pip --version check that is functionally inert — the command chain still terminates with the correct error if pip cannot be bootstrapped. No logic bugs, data integrity issues, or security problems were found. metaflow/metaflow_environment.py line 196 — redundant pip --version check worth removing for clarity. Important Files Changed
Reviews (3): Last reviewed commit: "Update metaflow/metaflow_environment.py" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
PR Type
Summary
Add multi-platform support to the
uvbootstrap path by selecting the correct release asset for the current OS and architecture instead of hardcoding the Linux x86_64 tarball. This also makes the generateduv synccommand shell-portable by removing theset -e;prefix.Issue
Fixes #2642
Reproduction
Runtime: local
Commands to run:
Where evidence shows up: test output in the local console
Before (error / log snippet)
That means bootstrap assumes:
This breaks portability for macOS and Windows environments and makes the bootstrap logic incompatible with non-Linux uv release assets.
The generated sync command also embeds:
which assumes a POSIX shell command layout instead of generating a portable command chain.
After (evidence that fix works)
Root Cause
metaflow/plugins/uv/bootstrap.py hardcodes a single uv release URL:
This bakes Linux x86_64 assumptions directly into the bootstrap path.
There are two separate issues caused by that:
Additionally, the generated sync command uses a shell preamble with set -e;, which is unnecessarily tied to POSIX shell syntax instead of building a portable command chain.
Why This Fix Is Correct
This fix restores the intended invariant that uv bootstrap should be determined by the current platform rather than by a hardcoded Linux asset.
The implementation is intentionally scoped:
This keeps the change focused on platform-aware asset selection and command generation without changing the rest of the uv environment workflow.
Failure Modes Considered
Unsupported platform / architecture combinations
The new helper raises an explicit error for unsupported (system, machine) pairs instead of silently downloading the wrong asset.
Archive format mismatch
Windows uv releases are distributed as zip files, while Linux/macOS use tarballs. The bootstrap now handles both formats explicitly and validates that the expected executable is present in the archive.
Tests
Added test/unit/test_uv_bootstrap.py covering:
Locally ran:
Non-Goals
This PR does not:
AI Tool Usage