18
18
19
19
import logging # noqa:E402
20
20
import subprocess
21
-
21
+ from distutils import version
22
22
from importlib import import_module
23
23
24
24
# We can now use logging so set up a simple configuration
52
52
}
53
53
54
54
PACKAGES = {
55
- "PyQt4 " : {
56
- "OpenBSD" : "py-qt4 " ,
57
- "FreeBSD" : "py27-qt4 " ,
58
- "Debian" : "python-qt4 " ,
59
- "Ubuntu" : "python-qt4 " ,
60
- "Ubuntu 12" : "python-qt4 " ,
61
- "openSUSE" : "python-qt " ,
62
- "Fedora" : "PyQt4 " ,
63
-
64
- "Gentoo" : "dev-python/PyQt4 " ,
55
+ "qtpy " : {
56
+ "OpenBSD" : "py-qtpy " ,
57
+ "FreeBSD" : "py27-QtPy " ,
58
+ "Debian" : "python-qtpy " ,
59
+ "Ubuntu" : "python-qtpy " ,
60
+ "Ubuntu 12" : "python-qtpy " ,
61
+ "openSUSE" : "python-QtPy " ,
62
+ "Fedora" : "python2-QtPy " ,
63
+ "Guix" : "" ,
64
+ "Gentoo" : "dev-python/QtPy " ,
65
65
"optional" : True ,
66
66
"description" :
67
- "You only need PyQt if you want to use the GUI."
67
+ "You only need qtpy if you want to use the GUI."
68
68
" When only running as a daemon, this can be skipped.\n "
69
- "However, you would have to install it manually "
70
- " because setuptools does not support PyQt. "
69
+ "Also maybe you need to install PyQt5 if your package manager "
70
+ " not installs it as qtpy dependency "
71
71
},
72
72
"msgpack" : {
73
73
"OpenBSD" : "py-msgpack" ,
@@ -363,21 +363,21 @@ def check_pyqt():
363
363
Here we are checking for PyQt4 with its version, as for it require
364
364
PyQt 4.8 or later.
365
365
"""
366
- QtCore = try_import (
367
- 'qtpy.QtCore ' , 'PyBitmessage requires PyQt 4.8 or later and Qt 4.7 or later.' )
366
+ qtpy = try_import (
367
+ 'qtpy' , 'PyBitmessage requires qtpy, PyQt 4.8 or later and Qt 4.7 or later.' )
368
368
369
- if not QtCore :
369
+ if not qtpy :
370
370
return False
371
371
372
- logger .info ('PyQt Version: %s' , QtCore . PYQT_VERSION_STR )
373
- logger .info ('Qt Version: %s' , QtCore . QT_VERSION_STR )
372
+ logger .info ('PyQt Version: %s' , qtpy . PYQT_VERSION )
373
+ logger .info ('Qt Version: %s' , qtpy . QT_VERSION )
374
374
passed = True
375
- if QtCore . PYQT_VERSION < 0x40800 :
375
+ if version . LooseVersion ( qtpy . PYQT_VERSION ) < '4.8' :
376
376
logger .error (
377
377
'This version of PyQt is too old. PyBitmessage requries'
378
378
' PyQt 4.8 or later.' )
379
379
passed = False
380
- if QtCore . QT_VERSION < 0x40700 :
380
+ if version . LooseVersion ( qtpy . QT_VERSION ) < '4.7' :
381
381
logger .error (
382
382
'This version of Qt is too old. PyBitmessage requries'
383
383
' Qt 4.7 or later.' )
@@ -386,7 +386,7 @@ def check_pyqt():
386
386
387
387
388
388
def check_msgpack ():
389
- """Do sgpack module check.
389
+ """Do msgpack module check.
390
390
391
391
simply checking if msgpack package with all its dependency
392
392
is available or not as recommended for messages coding.
0 commit comments