Skip to content

Commit

Permalink
build: exit and warn to restart after installing GUI libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
ElpadoCan committed Jul 1, 2023
1 parent bce94e2 commit 43d168f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cellacdc/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
def _setup_gui():
from . import qrc_resources_path, qrc_resources_light_path

warn_restart = False
# Force PyQt6 if available
try:
from PyQt6 import QtCore
Expand Down Expand Up @@ -67,6 +68,7 @@ def _setup_gui():
subprocess.check_call(
[sys.executable, '-m', 'pip', 'install', '-U', 'PyQt6']
)
warn_restart = True
break
elif answer.lower() == 'n':
raise e
Expand All @@ -75,14 +77,15 @@ def _setup_gui():
f'"{answer}" is not a valid answer. '
'Type "y" for "yes", or "n" for "no".'
)

try:
import pyqtgraph
except ModuleNotFoundError:
import subprocess
subprocess.check_call(
[sys.executable, '-m', 'pip', 'install', '-U', 'pyqtgraph']
)
warn_restart = True

try:
import seaborn
Expand All @@ -91,6 +94,13 @@ def _setup_gui():
subprocess.check_call(
[sys.executable, '-m', 'pip', 'install', '-U', 'seaborn']
)
warn_restart = True

if warn_restart:
exit(
'[WARNING]: Cell-ACDC had to install the required GUI libraries. '
'Please, re-start the software. Thank you for your patience!'
)

def _setup_app(splashscreen=False, icon_path=None, logo_path=None):
from qtpy import QtCore
Expand Down
3 changes: 3 additions & 0 deletions cellacdc/myutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,9 @@ def _install_homebrew_command():
def _brew_install_java_command():
return 'brew install --cask homebrew/cask-versions/adoptopenjdk8'

def _brew_install_hdf5():
return 'brew install hdf5'

def _apt_update_command():
return 'sudo apt-get update'

Expand Down

0 comments on commit 43d168f

Please sign in to comment.