Repository navigation
0.5: extras, GPU and offline env install; packaging pipeline; env-setup/updater/report UI - #15
Merged
Merged
Conversation
ShellConfig gains pythonExtras (always) and gpuExtras (when nvidia-smi finds a device; EnsureOptions.gpu and <APPID>_GPU override the probe). The lock stamp carries the extras, but stays the bare hash when there are none so existing installs do not re-sync. A wheelhouse (wheelhouse.json + every locked wheel + a python-build-standalone mirror) installs with no network: uv python install from the file:// mirror, uv venv, uv export --frozen, then uv pip install --offline --no-index --require-hashes. A frozen uv sync --offline --find-links cannot do it: uv only looks for registry-locked wheels in its cache. And uv venv refuses the mirror under UV_OFFLINE, hence the separate python install step. A probed GPU whose extras the wheelhouse lacks degrades to CPU and stamps +gpu=unavailable, so an air-gapped GPU machine does not retry online on every launch. Managed interpreters now live under <userData>/python. Refs directelectron/de_ground_crew#410
runEnvSetup streams throttled env_setup messages and, on failure, waits for the user (retry / install from a folder / quit) instead of leaving a dead window. registerUpdaterIpc and registerProblemReportIpc register the channels every app hand-wired. The bridge gains updater/report/envSetup and exports a ShellBridge type. EnvSetupOverlay, UpdateCard, UpdateDialog and ReportProblemDialog come from SpyDE with every string a prop. Refs directelectron/de_ground_crew#410
…, release workflow What SpyDE ships with, made app-agnostic, plus the shell-link script all three apps carried identically. python -m de_shell.js link makes the electron/shell link without the chicken-and-egg of a script living inside it. build-wheelhouse.mjs is new: the offline install's input, with markers evaluated for the target platform rather than the build host. installer.nsh scopes its sidecar sweep to this app's own userData and offers (default No, always No when silent) to remove the managed environment on uninstall. Refs directelectron/de_ground_crew#410
…our own interpreter The Ground Crew packaged run showed the venv linked to a python3.13 launcher in ~/.local/bin: uv python install drops one there (and a PEP 514 registry key) by default, and uv then discovers it ahead of the userData install dir. Both outlive an uninstall and point at a folder it deletes. UV_PYTHON_INSTALL_BIN=0, UV_PYTHON_INSTALL_REGISTRY=0 and UV_MANAGED_PYTHON=1 on every packaged uv call. build-wheelhouse: --no-extras for a CPU-only wheelhouse when the config names extras, and a clear error for git/path/URL requirements, which pip otherwise reports as being unable to hash version-control repositories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The de-shell half of directelectron/de_ground_crew#410: shipping an app as an installer, online or offline. What SpyDE does today moves into the shell, so Ground Crew and Autopilot can ship the same way.
What's in it
pythonEnv: extras, GPU, offline (main/pythonEnv.ts,main/config.ts)ShellConfig.pythonExtrasare always installed.gpuExtrasare installed only whennvidia-smifinds a device.EnsureOptions.gpuor<APPID>_GPU=0|1overrides the probe.gpuextra and the sync never passed--extra.wheelhouse.json, every locked wheel and a python-build-standalone mirror. The install runs:uv python installfrom thefile://mirror;uv venv;uv export --frozen;uv pip install --offline --no-index --require-hashes.uv sync --offline --find-linkscan't do this: uv looks for registry-locked wheels only in its cache.uv venvalso refuses the mirror underUV_OFFLINE, which is why installing the interpreter is a separate step.+gpu=unavailable. Without that stamp, an air-gapped GPU machine would retry online, and fail, on every launch. A GPU the user explicitly requested still fails if its extras are missing.<userData>/pythoninstead of%APPDATA%\uv\python, so nothing is left behind on uninstall.First-run, updater and report UI: one call each (
main/envSetup*.ts,main/shellIpc*.ts, preload, renderer)runEnvSetup(win, opts)streams throttledenv_setupmessages. On failure it waits for the user (Retry, Install from a folder…, Quit) instead of leaving a dead window.registerUpdaterIpc()andregisterProblemReportIpc()register the IPC channels.updater,reportandenvSetup, and exports aShellBridgetype.EnvSetupOverlay,UpdateCard,UpdateDialogandReportProblemDialogcome from SpyDE, with every string a prop.Packaging (
de_shell/js/packaging/, reached aselectron/shell/packaging/)python -m de_shell.js link <electronDir> [--soft], plusshell-link.mjs. These replace the copy all three apps carry, which is identical in each.bundle-python.mjsstages the<resources>/pythonpayload. It is configured by flags or adeShellblock inelectron/package.json.build-wheelhouse.mjs(new) builds the offline wheelhouse. It evaluates markers for the target platform, not the build host.installer.nsh:python-env.electron-builder.base.ymlis a shared base for an app's builder config toextends..github/workflows/electron-release.ymlis a reusable workflow (workflow_call) taken from SpyDE's release pipeline. It also attaches the Windows wheelhouse zip and signs with Azure Trusted Signing when the secrets are present.The README has a new Shipping an app section.
Testing
npm run typecheckis clean.npm run test:unit: 171 pass.uv run pytest: 127 pass, including 10 new tests forlink.bundle-python.mjs, built GPU and CPU wheelhouses withbuild-wheelhouse.mjs, then calledresolvePythonEnvfrom Node:userData/wheelhouse: found automatically.userData/python.Not yet exercised:
installer.nshhas never been through makensis.bundle-pythonhasn't been run with MinGit or with a multi-package workspace.The Ground Crew PR that adopts this will be the first real installer build.