Skip to content

Offline install: say Python comes from the wheelhouse, not a download - #32

Open
TheDrOnos wants to merge 2 commits into
directelectron:mainfrom
TheDrOnos:fix/offline-python-progress
Open

TheDrOnos wants to merge 2 commits into
directelectron:mainfrom
TheDrOnos:fix/offline-python-progress

Conversation

@TheDrOnos

@TheDrOnos TheDrOnos commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #31.

In an offline install, the interpreter step is uv python install <ver> with UV_PYTHON_INSTALL_MIRROR pointing at the wheelhouse's python/ folder. uv words that copy as a download, and runUv relayed its output unchanged. So the setup window showed "Downloading cpython-3.13.12-…" as its step, with the Download pill lit, although nothing is downloaded.

Change (js/main/pythonEnv.ts, the wheelhouse branch of setupEnv only):

  • The step is announced as [env-setup] installing Python <ver> from the wheelhouse, which the setup window shows as "Installing Python 3.13.12 from the wheelhouse".
  • uv's output for that step goes through the new withoutPythonDownloadLines. It drops uv's "Downloading cpython-…" and "Downloaded cpython-…" lines and passes the rest, so the log keeps "Installed Python …".
  • The filter works on whole lines. A chunk's unfinished last line is held until its end arrives or the step ends, so a line split across chunks is still dropped whole.
  • The online path is unchanged: there uv's wording is true.

Tests (pythonEnv.test.ts), on uv 0.13.4's real output for this step:

  • the download lines are dropped and the rest kept;
  • a download line split across chunks is dropped whole;
  • an unfinished last line still reaches the stream at flush;
  • through parseUvLine, the step reads "Installing Python 3.13.12 from the wheelhouse", and no event is in the downloading phase.

With the filter disabled, three of them fail: the first, second and fourth. All four failed before the function existed.

Checks:

  • npm run typecheck: clean.
  • npm run test:unit: 179 passed.

Not verified:

  • A packaged offline install end to end.
  • Other uv versions' wording for this step. The filter matches uv 0.13.4's "Downloading/Downloaded cpython-".
  • The output of the later offline steps (venv, export, pip install), as in the issue.

The changelog fragment is upcoming_changes/32.bugfix.rst, added in a second commit once the PR had its number, as #20 did.

The offline interpreter step runs `uv python install <ver>` with
UV_PYTHON_INSTALL_MIRROR pointing at the wheelhouse's python/ folder. uv
words that copy as a download ("Downloading cpython-…", "Downloaded
cpython-…"), runUv relayed it unchanged, and the setup window showed
"Downloading cpython-3.13.12-…" as its step, with the Download pill lit,
although nothing is downloaded.

The wheelhouse branch of setupEnv now announces the step as
"[env-setup] installing Python <ver> from the wheelhouse" and relays uv's
output through withoutPythonDownloadLines, which drops those two lines and
passes the rest ("Installed Python …"). It works on whole lines, holding a
chunk's unfinished last line until its end arrives or the step ends, so a
line split across chunks is still dropped whole. The online path keeps uv's
wording, which is true there.

Tests (pythonEnv.test.ts), on uv 0.13.4's real output for this step:
- the download lines are dropped and the rest kept;
- a download line split across chunks is dropped whole;
- an unfinished last line still reaches the stream at flush;
- through parseUvLine, the step reads "Installing Python 3.13.12 from the
  wheelhouse" and no event is in the downloading phase.
With the filter disabled, the first, second and fourth fail (26 passed,
3 failed); all of them failed before the function existed.

Checks: npm run typecheck clean; npm run test:unit 179 passed.

This branch has not been deployed

No deployments
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.

Offline install: setup says "Downloading cpython-…" although nothing is downloaded

1 participant