Skip to content

Portable build - #7

Merged
robertsamples merged 4 commits into
mainfrom
portable-build
Jun 29, 2026
Merged

Portable build#7
robertsamples merged 4 commits into
mainfrom
portable-build

Conversation

@robertsamples

Copy link
Copy Markdown
Owner

win only currently. Exe build runs cleanly without errors or stability issues during live test analysis

robertsamples and others added 4 commits June 29, 2026 01:38
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>
@robertsamples
robertsamples merged commit f4d531d into main Jun 29, 2026
7 checks passed
robertsamples added a commit that referenced this pull request Jun 30, 2026
@robertsamples
robertsamples deleted the portable-build branch June 30, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant