Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "deeranalysis"
version = "2026.1.0b1"
version = "2026.1.0b2"
description = "A graphical fitting and data managment tool for DEER spectroscopy, using DeerLab and DeerNet as fitting engines."
authors = [
{name = "Hugo Karas",email = "hkaras@ethz.ch"}
Expand Down
18 changes: 13 additions & 5 deletions src/deeranalysis/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
from urllib.parse import unquote
from flask import request as _flask_request, jsonify as _jsonify

if __name__ == "__main__" and getattr(sys, 'frozen', False):
# In a PyInstaller-frozen app, sys.executable is DeerAnalysis itself, so every helper
# process that `multiprocess` (used by Dash's DiskcacheManager) starts re-launches this
# entry point.
if len(sys.argv) >= 2 and sys.argv[-2] == '-c' and sys.argv[-1].startswith((
'from multiprocess.resource_tracker import main',
'from multiprocess.forkserver import main')):
exec(sys.argv[-1])
sys.exit()
from multiprocess import spawn as _mp_spawn
_mp_spawn.freeze_support() # runs the job and exits if this is a spawned worker

#os.environ['PYWEBVIEW_GUI'] = 'cocoa' # force macOS backend
os.environ['DEERANALYSIS_PYWEBVIEW'] = '1'

Expand Down Expand Up @@ -130,11 +142,7 @@ def wait_for_dash(window):
time.sleep(0.2)

if __name__ == "__main__":
# Background jobs (see components/jobs_drawer.py) run via DiskcacheManager with the
# "spawn" start method. On Windows, a PyInstaller-frozen spawned child re-executes this
# entry point, so freeze_support() must run first to stop it relaunching the whole app.
import multiprocess
multiprocess.freeze_support()
# Frozen child processes (job workers, resource tracker) are handled at the top of this file.

# Start Dash in a separate thread
dash_thread = threading.Thread(target=run_dash)
Expand Down
Loading