Skip to content

Commit

Permalink
update: windows pyinstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
singjc committed Mar 23, 2024
1 parent 429559e commit 4f8bb49
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions dist-scripts/pyinstaller/massdash.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import sys
from PyInstaller.building.build_main import Analysis, PYZ, EXE, COLLECT
from PyInstaller.utils.hooks import collect_all, collect_data_files, copy_metadata

from transformers.dependency_versions_check import pkgs_to_check_at_runtime
# from transformers.dependency_versions_check import pkgs_to_check_at_runtime

sys.setrecursionlimit(sys.getrecursionlimit() * 5)

Expand Down Expand Up @@ -36,7 +36,7 @@ print("Getting datas and hidden imports for requirements.")
if sys.platform[:6] == "darwin":
os.environ['KMP_DUPLICATE_LIB_OK']='True'

requirements = {'numpy', 'tk', project, "streamlit_javascript", "upsetplot", "distributed", 'torchaudio.lib.libtorchaudio'}
requirements = {'numpy', 'tk', project, "streamlit_javascript", "upsetplot", "distributed"}
datas = [(f"{site_packages[index]}/streamlit/runtime", "./streamlit/runtime")]
hidden_imports = set()
binaries = []
Expand Down Expand Up @@ -98,11 +98,11 @@ datas = [d for d in datas if ("__pycache__" not in d[0]) and (d[1] not in [".",
# if not os.path.exists(libssl_dll_path):
# datas.append((libssl_lib_path, "."))

for _pkg in ["python","accelerate"]:
if _pkg in pkgs_to_check_at_runtime:
pkgs_to_check_at_runtime.remove(_pkg)
for _pkg in pkgs_to_check_at_runtime:
datas += copy_metadata(_pkg)
# for _pkg in ["python","accelerate"]:
# if _pkg in pkgs_to_check_at_runtime:
# pkgs_to_check_at_runtime.remove(_pkg)
# for _pkg in pkgs_to_check_at_runtime:
# datas += copy_metadata(_pkg)


datas += collect_data_files("streamlit")
Expand All @@ -118,7 +118,7 @@ datas += copy_metadata("tk")
datas += collect_data_files("massdash")
datas += copy_metadata("massdash")

hidden_imports = ['pyopenms', 'joblib', 'tkinter', 'tkinter.filedialog', 'massdash', 'torchaudio.lib.libtorchaudio']
hidden_imports = ['pyopenms', 'joblib', 'tkinter', 'tkinter.filedialog', 'massdash']

a = Analysis(
[script_name],
Expand Down
6 changes: 3 additions & 3 deletions dist-scripts/pyinstaller/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
try:
import os
import massdash.main
from massdash.util import get_free_port
from massdash.util import check_free_port
if sys.platform[:6] == "darwin":
os.environ['KMP_DUPLICATE_LIB_OK']='True'
use_port = str(get_free_port())
massdash.main.gui(['--verbose', '--server_port', use_port, '--no_global_developmentMode', '--no_browser_gatherUsageStats'], standalone_mode=False)
use_port, port_available = check_free_port(8501)
massdash.main.gui(['--verbose', '--server_port', str(use_port), '--no_global_developmentMode', '--no_browser_gatherUsageStats'], standalone_mode=False)
except ImportError:
import sys
import traceback
Expand Down
6 changes: 3 additions & 3 deletions dist-scripts/windows/create_windows_installer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pip install -r requirements.txt
@REM pip install numpy==1.24.2
pip install tk
pip install onnxruntime
pip install torch
pip install torchmetrics
pip install transformers
@REM pip install torch
@REM pip install torchmetrics
@REM pip install transformers
pip install setuptools
pip install build
pip install pyinstaller==6.4.0
Expand Down
2 changes: 1 addition & 1 deletion dist-scripts/windows/massdash_innoinstaller.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "massdash"
#define MyAppVersion "0.0.8"
#define MyAppVersion "0.0.9"
#define MyAppPublisher "University of Toronto, Roest Lab"
#define MyAppURL "https://github.com/Roestlab/massdash"
#define MyAppExeName "massdash.exe"
Expand Down

0 comments on commit 4f8bb49

Please sign in to comment.