Repository navigation
Viewer installers: start Voilà without relying on PATH - #142
Merged
Merged
Conversation
Reported from a real Windows install: the "QuantUI Viewer" shortcut
opened a console that printed a message and closed immediately.
`quantui view` found Voila with shutil.which("voila"), and a shortcut
launch of an unactivated conda install has no Scripts/bin folder on
PATH, so it printed "Voila is not installed or not on PATH" and exited.
Reproduced on the Linux installer with PATH stripped to /usr/bin:/bin.
- run_viewer_app starts Voila as `<this python> -m voila` (PATH only as
fallback) and prepends the install's folders to PATH for the server,
as `conda activate` would (prefix, Library\bin, Scripts on Windows).
- It returns non-zero only if the viewer never came up (with a message);
a shutdown via the app's Exit button is a normal exit.
- SIGTERM/SIGHUP to the launcher now stop Voila too. Before, stopping
`quantui view` left Voila serving on its port (found while testing).
- Windows shortcut runs `cmd /c "...quantui.exe view || pause"`, so a
failure stays on screen instead of vanishing.
- CI: smoke_launch.py starts the installed viewer from a shell where the
install is not activated, fetches a page, then checks Voila stopped.
The old smoke test only ran `quantui view --help`, which missed this.
Locally the script passes on the fixed Linux install and fails on the
unfixed one ("exited early with code 1").
Tests: two new cases in tests/test_app_viewer.py; viewer, CLI and
code-quality tests pass; mypy clean; pre-commit clean.
Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration
Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The first CI run of smoke_launch.py on 6d89abb showed the main fix working on Windows (installed viewer started with the env off PATH, kernel started, HTTP 200), but its leftover-server check failed: the script stops quantui.exe with TerminateProcess, which runs no handlers, so Voila outlives it. The SIGTERM/SIGHUP forwarding added in 6d89abb is POSIX-only by nature. On Windows the script now kills the whole tree (taskkill /T /F) and skips that check; real use is covered there because closing the console window stops every process attached to it, and Exit stops Voila itself. macOS/Linux keep the check. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
test_voila_runs_as_module_of_this_interpreter expected the `python -m voila` command, which _viewer_voila_command only returns when the voila module is importable. Voila is in the [app] extra; CI installs [pyscf,ase,dev,xtb,ts], so the test failed there (and in any env without Voila). The test now reports voila as importable via find_spec, and a new test covers the PATH fallback and the not-found case. Contributions: - Claude (Opus 5.5): code edits, review, and conceptual discussion - Jonathan Schultz: overall vision, planning, review, and orchestration Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com> 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.
On a real Windows install, the "QuantUI Viewer" shortcut opened a console that printed a message and closed.
quantui viewlooked for thevoilacommand onPATH. A shortcut launch of an unactivated install doesn't put the install's folders onPATH, so the command printed "Voilà is not installed or not on PATH" and exited.Changes
quantui viewruns Voilà as<this python> -m voilaand usesPATHonly as a fallback. It also puts the install's folders onPATHfor the server, asconda activatewould.quantui view(SIGTERM/SIGHUP) now stops Voilà too, instead of leaving it serving on its port.cmd /c ... || pause, so a failure stays on screen.smoke_launch.pystarts the installed viewer from a shell where the install is not activated, fetches a page, then checks Voilà stopped. On Windows it kills the whole process tree and skips that last check. The old smoke test only ranquantui view --help, which missed this bug.Testing
tests/test_app_viewer.pycases:PATHis used as the fallback;PATH.[app]extra, which CI doesn't install.Authorship