Changes for PyInstaller to build with qtpy and PyQt4

This commit is contained in:
Dmitri Bogomolov 2020-10-20 14:42:58 +03:00
parent 3e3985267a
commit 782010fc19
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
2 changed files with 23 additions and 5 deletions

View File

@ -37,8 +37,17 @@ a = Analysis(
'setuptools.msvc', '_cffi_backend', 'setuptools.msvc', '_cffi_backend',
'plugins.menu_qrcode', 'plugins.proxyconfig_stem' 'plugins.menu_qrcode', 'plugins.proxyconfig_stem'
], ],
runtime_hooks=[os.path.join(hookspath, 'pyinstaller_rthook_plugins.py')], # https://github.com/pyinstaller/pyinstaller/wiki/Recipe-PyQt4-API-Version
excludes=['bsddb', 'bz2', 'tcl', 'tk', 'Tkinter', 'tests'] 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 = [ excluded_binaries = [
'QtOpenGL4.dll', 'QtOpenGL4.dll', 'QtSql4.dll', 'QtSvg4.dll', 'QtTest4.dll',
'QtSvg4.dll', 'QtWebKit4.dll', 'QtXml4.dll'
'QtXml4.dll',
] ]
a.binaries = TOC([x for x in a.binaries if x[0] not in excluded_binaries]) 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)