Skip to content

Commit

Permalink
added GDAL fix
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Jun 18, 2024
1 parent 889b8c1 commit e39d87a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
32 changes: 15 additions & 17 deletions freeze/SSM_SIS.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import os
from PyInstaller.building.build_main import Analysis, PYZ, EXE, COLLECT, TOC
from PyInstaller.compat import is_darwin, is_win

from hyo2.ssm_sis import __version__ as ssm_version
from hyo2.ssm2.app.gui.ssm_sis import app_info

sys.setrecursionlimit(20000)

Expand Down Expand Up @@ -77,7 +77,6 @@ def python_path() -> str:


def collect_folder_data(input_data_folder: str, relative_output_folder: str, recursively: bool = False):

data_toc = TOC()
if not os.path.exists(input_data_folder):
print("issue with folder: %s" % input_data_folder)
Expand Down Expand Up @@ -105,30 +104,30 @@ cartopy_data = collect_folder_data(input_data_folder=share_folder, relative_outp
recursively=True)

abc_data = collect_pkg_data('hyo2.abc2')
ss_data = collect_pkg_data('hyo2.soundspeed')
ssm_sis_data = collect_pkg_data('hyo2.ssm_sis')
ssm_data = collect_pkg_data('hyo2.ssm2')
pyside6_data = collect_pkg_data('PySide6')

icon_file = os.path.normpath(os.path.join(os.getcwd(), 'freeze', 'SSM_SIS.ico'))
if is_darwin:
icon_file = os.path.normpath(os.path.join(os.getcwd(), 'freeze', 'SSM_SIS.icns'))

a = Analysis(['SSM_SIS.py'],
binaries=[],
pathex=[],
hiddenimports=["PIL", "scipy._lib.messagestream", "cftime._cftime", "PySide6.QtPrintSupport",
"pyproj.datadir", "pkg_resources.py2_warn"],
excludes=["IPython", "PyQt4", "PyQt5", "pandas", "sphinx", "sphinx_rtd_theme", "OpenGL_accelerate",
"FixTk", "tcl", "tk", "_tkinter", "tkinter", "Tkinter", "wx",
"cartopy_offlinedata", "cartopy_userconfig"],
hookspath=None,
runtime_hooks=None)
binaries=[],
pathex=[],
hiddenimports=["PIL", "scipy._lib.messagestream", "cftime._cftime", "PySide6.QtPrintSupport",
"pyproj.datadir", "pkg_resources.py2_warn"],
excludes=["IPython", "PyQt4", "PyQt5", "pandas", "sphinx", "sphinx_rtd_theme", "OpenGL_accelerate",
"PySide2",
"FixTk", "tcl", "tk", "_tkinter", "tkinter", "Tkinter", "wx",
"cartopy_offlinedata", "cartopy_userconfig"],
hookspath=None,
runtime_hooks=None)

pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='SSM_SIS.%s%s' % (ssm_version, beta),
name='SSM_SIS',
debug=False,
strip=None,
upx=True,
Expand All @@ -141,9 +140,8 @@ coll = COLLECT(exe,
pyproj_data,
cartopy_data,
abc_data,
ss_data,
ssm_sis_data,
ssm_data,
pyside6_data,
strip=None,
upx=True,
name='SSM_SIS.%s%s' % (ssm_version, beta))
name='SSM_SIS.%s%s' % (app_info.app_version, beta))
2 changes: 1 addition & 1 deletion freeze/SoundSpeedManager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if is_darwin:
a = Analysis(['SoundSpeedManager.py'],
pathex=[],
hiddenimports=[],
excludes=['qgis', 'pandas', 'PyQt5', 'PySide2', 'shiboken2', 'wx'],
excludes=['qgis', 'pandas', 'fiona', 'PyQt5', 'PySide2', 'shiboken2', 'wx'],
hookspath=None,
runtime_hooks=None)

Expand Down
2 changes: 2 additions & 0 deletions hyo2/ssm2/app/gui/soundspeedmanager/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from PySide6 import QtCore, QtWidgets, QtGui

from hyo2.abc2.app.app_style.app_style import AppStyle
from hyo2.abc2.lib.gdal_aux import GdalAux
from hyo2.abc2.lib.package.pkg_helper import PkgHelper
from hyo2.abc2.lib.logging import set_logging
from hyo2.ssm2.app.gui.soundspeedmanager import app_info
Expand Down Expand Up @@ -50,6 +51,7 @@ def gui():
sys.exit(app.exit())

logger.debug("Init main win ...")
GdalAux.check_gdal_data(verbose=True)
main_win = MainWin()
sys.excepthook = main_win.exception_hook # install the pkg_exception hook
main_win.show()
Expand Down

0 comments on commit e39d87a

Please sign in to comment.