feat(packaging): add a portable Windows build - #633
Open
jsschwrz wants to merge 1 commit into
Open
Conversation
Copying this folder to another Windows machine has never worked: there is no venv and no lockfile, so every dependency lives in a user-scoped Python 3.12 install outside the repo. Re-pointing a shortcut at main_hcs.py fails on the first third-party import. Add a build script that produces a relocatable bundle (~287 MB zipped) carrying the interpreter, all 150 dependencies and the app, launched by a Squid.cmd that pins the bundled interpreter and sets CWD to software/ -- both of which the app requires and neither of which a bare shortcut provides. The script copies the known-good 3.12 tree rather than resolving a fresh environment, because the live dependency set has drifted from setup_22.04.sh (which still pins numpy<2 and napari==0.5.4). requirements-windows.txt records what actually runs; it sits at the repo root because software/.gitignore ignores *.txt. Also rewrite default_saving_path to a bare "Downloads" in the bundle. The guard in control/_def.py strips slashes but not a "C:" drive prefix, so a foreign absolute path is concatenated into garbage rather than falling back. check_drivers.py verifies interpreter, dependencies, both camera libraries and the serial port, which separates a driver problem from a Python problem on a freshly copied bundle where pythonw.exe would otherwise fail silently. The Daheng Galaxy SDK stays a target-machine prerequisite: gxipy loads GxIAPI.dll by bare name off the system PATH and ships a kernel-mode USB driver, so it cannot travel in a zip. The Toupcam DLL loads __file__-relative and does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Copying this folder to another Windows machine has never worked: there is no
venv and no lockfile, so every dependency lives in a user-scoped Python 3.12
install outside the repo. Re-pointing a shortcut at main_hcs.py fails on the
first third-party import.
Add a build script that produces a relocatable bundle (~287 MB zipped) carrying
the interpreter, all 150 dependencies and the app, launched by a Squid.cmd that
pins the bundled interpreter and sets CWD to software/ -- both of which the app
requires and neither of which a bare shortcut provides.
The script copies the known-good 3.12 tree rather than resolving a fresh
environment, because the live dependency set has drifted from setup_22.04.sh
(which still pins numpy<2 and napari==0.5.4). requirements-windows.txt records
what actually runs; it sits at the repo root because software/.gitignore
ignores *.txt.
Also rewrite default_saving_path to a bare "Downloads" in the bundle. The guard
in control/_def.py strips slashes but not a "C:" drive prefix, so a foreign
absolute path is concatenated into garbage rather than falling back.
check_drivers.py verifies interpreter, dependencies, both camera libraries and
the serial port, which separates a driver problem from a Python problem on a
freshly copied bundle where pythonw.exe would otherwise fail silently.
The Daheng Galaxy SDK stays a target-machine prerequisite: gxipy loads
GxIAPI.dll by bare name off the system PATH and ships a kernel-mode USB driver,
so it cannot travel in a zip. The Toupcam DLL loads file-relative and does.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com