Skip to content

Commit

Permalink
Fixed: guidata can be imported w/o Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 22, 2023
1 parent cc027de commit 9b0ffae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions guidata/configtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
from collections.abc import Callable
from typing import TYPE_CHECKING

from qtpy import PYQT5

from guidata.utils.misc import decode_fs_string, get_module_path

if TYPE_CHECKING: # pragma: no cover
Expand Down Expand Up @@ -293,6 +291,7 @@ def font_is_installed(font: str) -> list[str]:
list[str]: list of installed fonts
"""
# Importing Qt here because this module should be independent from it
from qtpy import PYQT5
from qtpy import QtGui as QG # pylint: disable=import-outside-toplevel

if PYQT5:
Expand Down
3 changes: 1 addition & 2 deletions guidata/tests/test_no_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

import os

os.environ["QT_API"] = "invalid_value" # Invalid Qt API


def test_imports_without_qt():
"""Test if some guidata features work without Qt"""
os.environ["QT_API"] = "invalid_value" # Invalid Qt API
try:
# pylint: disable=unused-import
# pylint: disable=import-outside-toplevel
Expand Down

0 comments on commit 9b0ffae

Please sign in to comment.