Portable build - #7
Merged
Merged
Conversation
Adds requirements.txt, build/mpact.spec, and build/build_windows.bat to
produce a standalone dist/MPACT/ folder end users can run without
installing Anaconda or any packages themselves. Built and smoke-tested:
the frozen exe imports PyQt5/pandas/numpy/scipy/matplotlib/seaborn/
scikit-learn/epam.indigo cleanly and reaches the styled main window
under an offscreen Qt platform.
Two non-obvious choices, documented in build/README.md and CLAUDE.md:
--onedir (not --onefile), since main.py reads/writes npatlas.tsv and
compoundimages/*.png via cwd-relative paths that need to persist next
to the exe; and contents_directory='.', since PyInstaller 6.x's default
onedir layout nests those files under _internal/ instead, breaking the
same assumption. epam.indigo's native DLL needed an explicit
collect_all('indigo') -- its hand-rolled load path is invisible to
PyInstaller's static import analysis.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pvclust.py's bootstrap dendrogram uses multiprocessing.Pool(), which on Windows needs multiprocessing.freeze_support() called before any other code when running from a frozen (PyInstaller) executable. Without it, each worker process re-executes the entire bundled program from scratch -- including creating a brand new QApplication and MainWindow -- instead of just running the pool target. Confirmed this exact failure mode with a minimal standalone repro exe: without freeze_support(), a 4-worker Pool() in a frozen build recurses exponentially (observed tens of thousands of relaunched processes before the host OS ran out of resources). With the guard added here, multiprocessing.freeze_support() is a documented no-op under any non-frozen interpreter (plain `python main.py`, Spyder), so this is safe for every other way MPACT is launched. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <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.
win only currently. Exe build runs cleanly without errors or stability issues during live test analysis