Skip to content

Commit

Permalink
don't install Qt by default, require pyside6 to be <6.7, check pyside…
Browse files Browse the repository at this point in the history
… availability on editor launch
  • Loading branch information
leon-thomm committed May 19, 2024
1 parent 5eb2827 commit 11ce084
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
f"{RYVEN_PATH}/ryven/example_nodes/std",
f"{RYVEN_PATH}/ryven/example_nodes/linalg",
],
qt_api='pyside2',
qt_api='pyside6',
show_dialog=False,
)
27 changes: 27 additions & 0 deletions ryven-editor/ryven/main/Ryven.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@
from ryven.main.args_parser import process_args


def check_pyside_available(qt_api: str):
if qt_api == 'pyside2':
try:
import PySide2
except ImportError:
sys.exit(
'You are trying to use PySide2 as the Qt API, but it is not available. '
'please install it, or use pyside6 as the Qt API. Either of those can '
'installed through pip, e.g. `pip install pyside2` or `pip install \'pyside6<6.7\'`. '
)
elif qt_api == 'pyside6':
try:
import PySide6
except ImportError:
sys.exit(
'You are trying to use PySide6 as the Qt API, but it is not available. '
'please install it, or use pyside2 as the Qt API. Either of those can '
'installed through pip, e.g. `pip install pyside2` or `pip install \'pyside6<6.7\'`. '
)
else:
sys.exit(
f'Error: Illegal Qt API: "{qt_api}". '
f'Use either "pyside2" or "pyside6". '
)


def run(*args_,
qt_app=None, gui_parent=None, use_sysargs=True,
**kwargs):
Expand Down Expand Up @@ -72,6 +98,7 @@ def run(*args_,
#

# Init environment
check_pyside_available(conf.qt_api)
os.environ['RYVEN_MODE'] = 'gui'
os.environ['QT_API'] = conf.qt_api
from ryven.node_env import init_node_env
Expand Down
5 changes: 5 additions & 0 deletions ryven-editor/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ install_requires =
Pygments
textdistance
packaging
extras_require =
PySide2 =
PySide2
PySide6 =
PySide6 = <6.7

[options.entry_points]
console_scripts =
Expand Down
1 change: 0 additions & 1 deletion ryvencore-qt/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ include_package_data = True
python_requires = >=3.6, <3.11
install_requires =
ryvencore ==0.4.*
PySide2
QtPy
waiting
textdistance

0 comments on commit 11ce084

Please sign in to comment.