Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions qtpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

"""

from distutils.version import LooseVersion
from packaging.version import parse
import os
import platform
import sys
Expand Down Expand Up @@ -121,15 +121,15 @@ class PythonQtWarning(Warning):
PYSIDE_VERSION = None

if sys.platform == 'darwin':
macos_version = LooseVersion(platform.mac_ver()[0])
if macos_version < LooseVersion('10.10'):
if LooseVersion(QT_VERSION) >= LooseVersion('5.9'):
macos_version = parse(platform.mac_ver()[0])
if macos_version < parse('10.10'):
if parse(QT_VERSION) >= parse('5.9'):
raise PythonQtError("Qt 5.9 or higher only works in "
"macOS 10.10 or higher. Your "
"program will fail in this "
"system.")
elif macos_version < LooseVersion('10.11'):
if LooseVersion(QT_VERSION) >= LooseVersion('5.11'):
elif macos_version < parse('10.11'):
if parse(QT_VERSION) >= parse('5.11'):
raise PythonQtError("Qt 5.11 or higher only works in "
"macOS 10.11 or higher. Your "
"program will fail in this "
Expand Down Expand Up @@ -160,9 +160,9 @@ class PythonQtWarning(Warning):
PYSIDE2 = True

if sys.platform == 'darwin':
macos_version = LooseVersion(platform.mac_ver()[0])
if macos_version < LooseVersion('10.11'):
if LooseVersion(QT_VERSION) >= LooseVersion('5.11'):
macos_version = parse(platform.mac_ver()[0])
if macos_version < parse('10.11'):
if parse(QT_VERSION) >= parse('5.11'):
raise PythonQtError("Qt 5.11 or higher only works in "
"macOS 10.11 or higher. Your "
"program will fail in this "
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
version=version_ns['__version__'],
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
python_requires='>=3.6',
install_requires=['packaging'],
keywords=["qt PyQt5 PyQt6 PySide2 PySide6"],
url='https://github.com/spyder-ide/qtpy',
license='MIT',
Expand Down