Skip to content

fix(microsandbox): get uv with the image's Python, not the pip-less virtualenv - #647

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-vdn7f8
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-vdn7f8

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: rerunning the install line on a Mac with the microsandbox backend stopped at "Getting uv" with /data/.lens/venv/bin/python3: No module named pip.

After: the sandbox gets uv and uvx with the image's own Python and carries on to the build.

Motivation and Context

#632 made run.sh fetch uv again when uvx is missing. An install made before that has uv and the backend's virtualenv in the volume but no uvx, and run.sh puts $OPT/venv/bin first in PATH, so python3 -m pip ran the virtualenv's Python, which uv created without pip. The new microsandbox/uv.sh asks for the image's Python (sys._base_executable) whatever comes first in PATH, and uv sync --python uses the same one.

Steps to reproduce (if appropriate):

sh microsandbox/test-uv.sh makes a pip-less venv, puts it first in PATH and leaves uv without uvx. With the old python3 -m pip it fails with exactly the error from the log ("No module named pip"); with the fix all three checks pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit). (shellcheck clean)
  • I added or updated tests. (microsandbox/test-uv.sh, in the Nx microsandbox test target)
  • n/a docs: no behaviour or setting changed.
  • Changelog fragment changelog.d/microsandbox-uv-pip.md.

Done questions (AGENTS.md)

  • Goal: the reinstall gets past "Getting uv"; merged on green CI.
  • Agents: n/a, install fix.
  • Zero setup: no new prerequisite; rerun the install line.
  • Fewest clicks: n/a.
  • Configurable: n/a, no settings.
  • Light: unchanged.
  • Private and secure: n/a, no new surface.
  • Cost: n/a, no model calls.
  • User decides: defaults unchanged.
  • Upgrades: this is the upgrade fix; no stored-data change.
  • Honest: n/a.
  • Tests, docs and generated files updated.
  • Open: no new dependencies.
  • Reported in the project thread; refine later: none.
  • Reuse: same pip-from-PyPI path as before, only the interpreter changed.

Generated by Claude Code

…irtualenv

An install made before uvx was needed had uv and the backend's virtualenv
in the volume but no uvx, so run.sh fetched uv again with python3, which
PATH resolved to the virtualenv's (no pip): "No module named pip" at
"Getting uv". uv.sh now asks the image's Python (sys._base_executable),
whatever is first in PATH; test-uv.sh reproduces it with a pip-less venv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JvRqz2gFGRwwZc4qAfj74Q
@adeelahmad adeelahmad self-assigned this Oct 18, 2026
@adeelahmad
adeelahmad marked this pull request as ready for review October 18, 2026 17:57
@adeelahmad
adeelahmad merged commit 6ebfa2a into main Oct 18, 2026
18 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-vdn7f8 branch October 18, 2026 18:13
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