Runnable with both Python3 and Python2, with both PyQt5 and PyQt4 by using Qt.py #2250

Open
kashikoibumi wants to merge 127 commits from kashikoibumi/py3qt into v0.6
2 changed files with 23 additions and 5 deletions
Showing only changes of commit 782010fc19 - Show all commits

View File

@ -37,8 +37,17 @@ a = Analysis(
'setuptools.msvc', '_cffi_backend',
'plugins.menu_qrcode', 'plugins.proxyconfig_stem'
],
runtime_hooks=[os.path.join(hookspath, 'pyinstaller_rthook_plugins.py')],
excludes=['bsddb', 'bz2', 'tcl', 'tk', 'Tkinter', 'tests']
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version
runtime_hooks=[
os.path.join(hookspath, hook) for hook in (
'pyinstaller_rthook_pyqt4.py',
'pyinstaller_rthook_plugins.py'
)],
excludes=[
'bsddb', 'bz2',
'PyQt4.QtOpenGL', 'PyQt4.QtOpenGL', 'PyQt4.QtSql',
'PyQt4.QtSvg', 'PyQt4.QtTest', 'PyQt4.QtWebKit', 'PyQt4.QtXml',
'tcl', 'tk', 'Tkinter', 'win32ui', 'tests']
)
@ -77,9 +86,8 @@ a.datas += addTranslations()
excluded_binaries = [
'QtOpenGL4.dll',
'QtSvg4.dll',
'QtXml4.dll',
'QtOpenGL4.dll', 'QtSql4.dll', 'QtSvg4.dll', 'QtTest4.dll',
'QtWebKit4.dll', 'QtXml4.dll'
]
a.binaries = TOC([x for x in a.binaries if x[0] not in excluded_binaries])

View File

@ -0,0 +1,10 @@
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version
import sip
sip.setapi(u'QDate', 2)
sip.setapi(u'QDateTime', 2)
sip.setapi(u'QString', 2)
sip.setapi(u'QTextStream', 2)
sip.setapi(u'QTime', 2)
sip.setapi(u'QUrl', 2)
sip.setapi(u'QVariant', 2)