-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Use QRegularExpression only for Qt 5.5+ #3994
PR: Use QRegularExpression only for Qt 5.5+ #3994
Conversation
|
||
if PYQT5: | ||
PYQT_VERSION = float(PYQT_VERSION) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe its cleaner to define
PYQT55_VERSION = float(PYQT_VERSION) > 5.5
And use that in the conditions below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm no, It's given an error due versions like 4.11.4
I'll implement:
MINOR_VERSION = int(PYQT_VERSION.split('.')[1])
a1efb7a
to
8459149
Compare
Well.. sure, I meant using a single global thing, not how you were comparing versions (which, yes is probably wrong) No need You can compare tuples also a = (5, 5)
b = (5, 5, 1)
a > b
b < a But I guess what you did now works also |
8459149
to
c77dbd1
Compare
@goanpeca I followed your both advices, I think this is ready :) |
|
||
if PYQT5: | ||
PYQT55_VERSION = tuple(int(x) for x in PYQT_VERSION.split('.')) >= (5, 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rlaverde, although Qt and PyQt versions usually match (e.g. Qt 5.5 and PyQt 5.5 are installed at the same time), that's not always the case. For example, Ubuntu 16.10 comes with Qt 5.6 and PyQt 5.7.
So please use QT_VERSION instead of PYQT_VERSION here. We define QT_VERSION here:
https://github.com/spyder-ide/qtpy/blob/master/qtpy/__init__.py#L87
|
||
if PYQT5: | ||
QT55_VERSION = tuple(int(x) for x in QT_VERSION.split('.')) >= (5, 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use check_version
from utils/programs.py
to do the comparison here
Thanks @rlaverde! |
Fixes #3989