Repository navigation
Windows: one-line install, tests pass on Windows; standalone install needs [pyqt6] - #46
Merged
Merged
Conversation
…extra - README: a PowerShell one-liner for Windows (clone, venv, install with the [pyqt6] extra, desktop shortcut), with how to update and run from a terminal and why it uses `py` (a fresh Windows's `python` is a Store stub). - README: the standalone snippet installed `.` without a Qt binding; since #40 qtpy is the only Qt dependency, so it could not open a window. It now installs ".[pyqt6]", as the Requirements section already says. - README: Windows test commands (PYTHONUTF8 for two tests that read source files with the default encoding; QT_QPA_PLATFORM=windows for real GL) and the two tests that fail on Windows only (they expect `/` in paths). - create_shortcut.py: prefer the `ndviewer-light` next to the running interpreter over the first one on PATH, so running the script with a venv's python (as the one-liner does, without activating it) points the shortcut at that venv's launcher instead of falling back to `python -m ndviewer_light`. tests/test_create_shortcut.py covers the order: next to the interpreter, then PATH, then `python -m`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_existing_field_without_metadata_is_broken and test_broken_fov_fails_the_load expected `B/3/0` in error messages, which name the field by its filesystem path (`B\3\0` on Windows). They now build the expected fragment with pathlib, so the message is still checked for the field on every OS. - test_3d_scales.py and test_channel_names.py read core.py with the locale encoding (cp1252 on Windows), which fails on its non-ASCII characters; they now read it as UTF-8. - README: drop the PYTHONUTF8 step and the known-failures note. Windows, run as the README says: offscreen 312 passed / 3 skipped; real GL 315 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…directory shutil.which(path=...) on Windows Python <= 3.11 still searches the current directory first, so a stray ndviewer-light.exe there won over the running interpreter's sibling launcher. Check the sibling path directly, then fall back to PATH, then to `python -m ndviewer_light`. Co-Authored-By: Claude Opus 5.5 <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.
Summary
Windows install in one line, a fix to the standalone install instructions, and a test suite that passes on Windows.
One-line Windows install (README)
This clones, creates a venv inside the clone, installs with the
[pyqt6]extra, and puts an NDViewer Light shortcut on the Desktop. The README also covers how to update and how to run from a terminal. It explains why the command usespy: on a fresh Windows,pythonis a stub that opens the Microsoft Store.Tested verbatim (except that the clone came from this branch) in a fresh PowerShell on Windows 11 with Python 3.10:
ndviewer-light.exe;Standalone install was missing a Qt binding
The standalone snippet ran
pip3 install .. Since #40,qtpyis the only Qt dependency, so a fresh install following the README had no binding and could not open a window. It now runspip3 install ".[pyqt6]", which is what the Requirements section already says.create_shortcut.pytargets the venv it is run withThe script looked up
ndviewer-lightonPATHonly. Running it with a venv's python without activating the venv, as the one-liner does, therefore fell back topython.exe -m ndviewer_light; if anotherndviewer-lightwas on PATH, it picked that one instead. It now checks next tosys.executablefirst, thenPATH, then falls back topython -m.tests/test_create_shortcut.pycovers that order.Tests pass on Windows as-is
test_existing_field_without_metadata_is_brokenandtest_broken_fov_fails_the_loadexpectedB/3/0in error messages. Those messages name the field by its filesystem path, which isB\3\0on Windows. The expected fragment is now built withpathlib, so the field is still checked on every OS.test_3d_scales.pyandtest_channel_names.pyreadcore.pywith the locale encoding, which is cp1252 on Windows and fails on its non-ASCII characters. They now read it as UTF-8.Run as the README says, on Windows 11 / Python 3.10 / PyQt5: offscreen 312 passed, 3 skipped; real GL (
QT_QPA_PLATFORM=windows NDVL_REAL_GL=1) 315 passed.black --check .andruff checkare clean.🤖 Generated with Claude Code