Repository navigation
feat: add Windows setup script and launcher - #642
Merged
Merged
Conversation
The repo has no Windows install path. setup_22.04.sh is Ubuntu-only (apt, udev,
dialout, apt-mark), and the forum post the README links for Windows predates the
PyQt6 work -- it installs Python 3.10, PyQt5 and napari 0.5.6. So there was no
reproducible way to stand this software up on Windows.
setup_windows.ps1 is the counterpart of setup_22.04.sh: it installs Git and
Python 3.12 via winget, clones recursively, builds a virtualenv with the same
pinned PyQt6 6.11 / napari 0.7.1 stack, seeds machine_configs, and writes Desktop
shortcuts. Steps with no Windows equivalent (apt, udev rules, dialout, apt-mark)
are dropped; camera drivers are vendor installers rather than bundled .run files,
so the script reports what is still needed instead of installing them.
Three differences from the Ubuntu script are deliberate:
* A virtualenv, not a system-wide pip install. Windows has no distro Python to
protect, and an isolated env is the only way to be sure exactly one Qt
binding is present -- which napari/vispy OpenGL rendering requires.
* PATH is re-read from the registry after winget runs. The installers update
the registry, not the running process, so git.exe would otherwise still be
missing -- and control/utils.py imports GitPython at module scope, which
raises ImportError without a git executable.
* The script refuses to guess a configuration*.ini. _def.py globs that pattern
and silently takes the first match, so it reports when zero or several are
present and lists the candidates instead.
main_hcs.bat is the launcher the shortcuts point at. It exists so a startup
failure stays readable: a shortcut aimed straight at python.exe closes its
console the instant the process dies, so a bad config or a missing camera driver
would flash past unreadable. It is the counterpart of Terminal=true in the
.desktop entry setup_22.04.sh writes, and doubles as a CLI entry point that
resolves the interpreter and working directory.
Verified on Windows 11 x64: the script runs clean and idempotently against an
existing checkout (pip check reports nothing broken; qtpy resolves to PyQt6 with
Qt 6.11.0, napari 0.7.1, numpy 2.5.2, opencv 5.0.0), and main_hcs.bat --simulation
brings up the GUI.
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.
Problem
There is no reproducible way to install this software on Windows.
setup_22.04.shis Ubuntu-only: apt, udev rules,dialout,apt-mark, bundled.runcamera installers.What this adds
setup_windows.ps1— the counterpart ofsetup_22.04.sh. Installs Git + Python 3.12 via winget, clones recursively, builds a virtualenv with the same pinned PyQt6 6.11 / napari 0.7.1 stack, seedsmachine_configs, and writes Desktop shortcuts. Steps with no Windows equivalent are dropped; camera drivers are vendor installers, so the script reports what remains rather than installing it.main_hcs.bat— the launcher the shortcuts point at..gitattributes— two lines pinning*.bat/*.ps1toeol=crlf. The repo had none, andcmd.execan misparse a multi-lineif errorlevel 1 ( ... )block in a.batstored with LF — a failure that presents as a syntax error rather than a line-ending problem.Deliberate differences from the Ubuntu script
git.exeis still missing — andcontrol/utils.pyimports GitPython at module scope, which raisesImportErrorwith no git executable. That makes git a hard runtime requirement, not just an installer one.configuration*.ini._def.pyglobs that pattern and silently takes the first match, so the script reports when zero or several are present and lists the candidates. It does seedillumination_channel_config.yamlfrom the example (its absence degrades the GUI and fails ~13 tests) but warns loudly that the laser lines must be checked.Why this can't target master
setup_windows.ps1installs PyQt6 6.11 + napari 0.7.1. Onmasterthat produces an environment the code cannot run in — master still setsQT_API = "pyqt5"and uses four APIs that don't exist in PyQt6:These are the exact APIs #622 fixes. They sit inside functions, so the modules import fine and the GUI then fails during construction — and because qtpy falls back from a missing binding with only a warning (
Selected binding 'pyqt5' could not be found; falling back to 'pyqt6'), the resulting failure is confusing to diagnose. So this belongs on top of #622.Verification
On Windows 11 x64, run against an existing checkout to confirm idempotency:
Re-running reuses the venv, leaves an existing
illumination_channel_config.yamlalone, detects the singleconfiguration*.ini, and exits 0.main_hcs.bat --simulationbrings up the GUI.Full suite on this branch: 1634 passed, 0 failed, 12 skipped.
Note on scope
This makes Windows a supported platform, which is a policy question as much as a technical one — the README currently says Ubuntu 22.04 is the most tested platform and says nothing about Windows beyond the forum link. Happy to add a README section pointing at this script if you want it discoverable, or to leave it undocumented as a best-effort path.