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