From 64d59053153aeeaa8d8b5b99a66fa3cb3868f3e9 Mon Sep 17 00:00:00 2001 From: dbouget Date: Fri, 18 Aug 2023 14:23:58 +0200 Subject: [PATCH] Adding pydicom hook for executable --- assets/hooks/hook-pydicom.py | 7 +++++++ assets/main.spec | 2 +- assets/main_arm.spec | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 assets/hooks/hook-pydicom.py diff --git a/assets/hooks/hook-pydicom.py b/assets/hooks/hook-pydicom.py new file mode 100644 index 0000000..c297cb1 --- /dev/null +++ b/assets/hooks/hook-pydicom.py @@ -0,0 +1,7 @@ +from PyInstaller.utils.hooks import collect_submodules +from PyInstaller.utils.hooks import collect_data_files, copy_metadata + +hiddenimports = collect_submodules("pydicom") + +datas = copy_metadata("pydicom") +datas += collect_data_files("pydicom") diff --git a/assets/main.spec b/assets/main.spec index 27ca77d..bcbf756 100644 --- a/assets/main.spec +++ b/assets/main.spec @@ -20,7 +20,7 @@ print("PLATFORM:", sys.platform) # fix hidden imports hidden_imports = loadtxt(cwd + "/assets/requirements.txt", comments="#", delimiter=",", unpack=False, dtype=str) hidden_imports = [x.split("=")[0] for x in hidden_imports] + ["medpy", "ants", "sklearn", "scikit-learn", - "statsmodels", "gevent", "distutils", "PySide6", "gdown", "rt_utils", "raidionicsrads", "raidionicsseg"] + "statsmodels", "gevent", "distutils", "PySide6", "gdown", "pydicom", "rt_utils", "raidionicsrads", "raidionicsseg"] hidden_imports = [x.lower() for x in hidden_imports] # copy dependencies and images, remove if folder already exists diff --git a/assets/main_arm.spec b/assets/main_arm.spec index 3a1ae80..aa13ff7 100644 --- a/assets/main_arm.spec +++ b/assets/main_arm.spec @@ -19,7 +19,7 @@ print("PLATFORM:", sys.platform) # fix hidden imports hidden_imports = loadtxt(cwd + "/assets/requirements.txt", comments="#", delimiter=",", unpack=False, dtype=str) hidden_imports = [x.split("=")[0] for x in hidden_imports] + ["medpy", "sklearn", "scikit-learn", - "statsmodels", "gevent", "distutils", "PySide6", "gdown", "rt_utils", "raidionicsrads", "raidionicsseg"] + "statsmodels", "gevent", "distutils", "PySide6", "gdown", "pydicom", "rt_utils", "raidionicsrads", "raidionicsseg"] hidden_imports = [x.lower() for x in hidden_imports] # copy dependencies and images, remove if folder already exists