-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from Carifio24/qt-optional
Make qtpy an optional dependency
- Loading branch information
Showing
8 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
from .connect import * # noqa | ||
from .autoconnect import * # noqa | ||
try: | ||
from .connect import * # noqa | ||
from .autoconnect import * # noqa | ||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
__all__ = [ | ||
"PYQT5_INSTALLED", "PYQT6_INSTALLED", | ||
"PYSIDE2_INSTALLED", "PYSIDE6_INSTALLED", | ||
"QTPY_INSTALLED", "QT_INSTALLED", | ||
"SKIP_QT_TEST" | ||
] | ||
|
||
|
||
def package_installed(package): | ||
from importlib.util import find_spec | ||
return find_spec(package) is not None | ||
|
||
|
||
PYQT5_INSTALLED = package_installed("PyQt5") | ||
PYQT6_INSTALLED = package_installed("PyQt6") | ||
PYSIDE2_INSTALLED = package_installed("PySide2") | ||
PYSIDE6_INSTALLED = package_installed("PySide6") | ||
QTPY_INSTALLED = package_installed("qtpy") | ||
QT_INSTALLED = PYQT5_INSTALLED or PYQT6_INSTALLED or PYSIDE2_INSTALLED or PYSIDE6_INSTALLED | ||
SKIP_QT_TEST = not (QTPY_INSTALLED and QT_INSTALLED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters