@@ -240,7 +240,7 @@ def py_arch(self):
240240 @property
241241 def prepath (self ):
242242 """Return PATH contents to be prepend to the environment variable"""
243- path = [r"Lib\site-packages\PyQt4" ,
243+ path = [r"Lib\site-packages\PyQt5" , r"Lib\site-packages\ PyQt4" ,
244244 "" , # Python root directory (python.exe)
245245 "DLLs" , "Scripts" , r"..\tools" , r"..\tools\mingw32\bin"
246246 ]
@@ -466,6 +466,11 @@ def _install_required_packages(self):
466466 self .install_package ('%s-([0-9\.]*[a-z]*[0-9]?)(.*)(\.exe|\.whl)' %
467467 'setuptools' , install_options = ['--upgrade' , '--no-deps' ])
468468
469+ #Pyqt5 (doesn't currently install in build this way, reason unclear)
470+ #self.install_package(
471+ # 'PyQt5-([0-9\.\-]*)-gpl-Py%s-Qt([0-9\.\-]*)%s.exe'
472+ # % (self.python_version, self.pyqt_arch))
473+
469474 # Install 'main packages' first (was before Wheel idea, keep for now)
470475 for happy_few in ['pip' , 'wheel' , 'pywin32' , 'six' , 'numpy' , 'spyder' ,
471476 'scipy' , 'matplotlib' , 'pandas' ]:
@@ -549,17 +554,29 @@ def _create_launchers(self):
549554 # args='register_python',
550555 # workdir='${WINPYDIR}\Scripts')
551556
552- self .create_launcher ('Qt Demo.exe' , 'qt.ico' , args = 'qtdemo.pyw' ,
553- workdir = r'${WINPYDIR}\Lib\site-packages\PyQt4\examples\demos\qtdemo' )
554- self .create_launcher ('Qt Assistant.exe' , 'qtassistant.ico' ,
555- command = r'${WINPYDIR}\Lib\site-packages\PyQt4\assistant.exe' ,
556- workdir = r'${WINPYDIR}' )
557- self .create_launcher ('Qt Designer.exe' , 'qtdesigner.ico' ,
558- command = r'${WINPYDIR}\Lib\site-packages\PyQt4\designer.exe' ,
559- workdir = r'${WINPYDIR}' )
560- self .create_launcher ('Qt Linguist.exe' , 'qtlinguist.ico' ,
561- command = r'${WINPYDIR}\Lib\site-packages\PyQt4\linguist.exe' ,
562- workdir = r'${WINPYDIR}' )
557+ python_lib_dir = osp .join (self .winpydir , self .python_name ,
558+ r"Lib\site-packages" )
559+ # manage Qt4, Qt5
560+ for QtV in (5 , 4 ):
561+ PyQt = 'PyQt%s' % QtV
562+ QtDemo_path = 'demos\qtdemo' if QtV == 4 else 'qtdemo'
563+ if osp .isdir (osp .join (python_lib_dir , PyQt )):
564+ self .create_launcher ('Qt%s Demo.exe' % QtV , 'qt.ico' ,
565+ args = 'qtdemo.pyw' , workdir =
566+ r'${WINPYDIR}\Lib\site-packages\%s\examples\%s' %
567+ (PyQt , QtDemo_path ) )
568+ self .create_launcher ('Qt%s Assistant.exe' % QtV ,
569+ 'qtassistant.ico' ,
570+ command = r'${WINPYDIR}\Lib\site-packages\%s\assistant.exe' %
571+ PyQt , workdir = r'${WINPYDIR}' )
572+ self .create_launcher ('Qt%s Designer.exe' % QtV ,
573+ 'qtdesigner.ico' ,
574+ command = r'${WINPYDIR}\Lib\site-packages\%s\designer.exe' %
575+ PyQt , workdir = r'${WINPYDIR}' )
576+ self .create_launcher ('Qt%s Linguist.exe' % QtV ,
577+ 'qtlinguist.ico' ,
578+ command = r'${WINPYDIR}\Lib\site-packages\%s\linguist.exe' %
579+ PyQt , workdir = r'${WINPYDIR}' )
563580 if self .python_version [0 ] == '3' :
564581 ipython_exe = 'ipython3.exe'
565582 ipython_scr = 'ipython3-script.py'
@@ -919,8 +936,10 @@ def _create_batch_scripts(self):
919936call %~dp0env.bat
920937call %~dp0register_python.bat --all""" )
921938 self .create_python_batch ('wpcp.bat' , 'wpcp' , workdir = 'Scripts' )
922- self .create_python_batch ('pyqt_demo.bat' , 'qtdemo.pyw' ,
923- workdir = r'Lib\site-packages\PyQt4\examples\demos\qtdemo' )
939+ self .create_python_batch ('pyqt4_demo.bat' , 'qtdemo.pyw' ,
940+ workdir = r'Lib\site-packages\PyQt4\examples\demos\qtdemo' )
941+ self .create_python_batch ('pyqt5_demo.bat' , 'qtdemo.pyw' ,
942+ workdir = r'Lib\site-packages\PyQt5\examples\qtdemo' )
924943
925944 # pre-run wingw batch
926945 print ('now pre-running extra mingw' )
@@ -1155,31 +1174,29 @@ def make_all(build_number, release_level, pyver,
11551174 # DO create only what version at a time
11561175 # You may have to manually delete previous build\winpython-.. directory
11571176
1158- make_all (2 , '' , pyver = '3.4' , rootdir = r'D:\Winpython' ,
1159- verbose = False , archis = (32 , ))
1160- # make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
1161- # verbose=False, archis=(64, ), flavor='')
1162- #make_all(7 , '', pyver='3.3', rootdir=r'D:\Winpython',
1177+ # make_all(3 , '', pyver='3.4', rootdir=r'D:\Winpython',
1178+ # verbose=False, archis=(32, ))
1179+ make_all (3 , '' , pyver = '3.4' , rootdir = r'D:\Winpython' ,
1180+ verbose = False , archis = (64 , ), flavor = '' )
1181+ #make_all(8 , '', pyver='3.3', rootdir=r'D:\Winpython',
11631182 # verbose=False, archis=(32, ))
1164- #make_all(7 , '', pyver='3.3', rootdir=r'D:\Winpython',
1183+ #make_all(8 , '', pyver='3.3', rootdir=r'D:\Winpython',
11651184 # verbose=False, archis=(64, ))
1166- #make_all(4 , '', pyver='2.7', rootdir=r'D:\Winpython',
1185+ #make_all(5 , '', pyver='2.7', rootdir=r'D:\Winpython',
11671186 # verbose=False, archis=(32, ))
1168- #make_all(4 , '', pyver='2.7', rootdir=r'D:\Winpython',
1187+ #make_all(5 , '', pyver='2.7', rootdir=r'D:\Winpython',
11691188 # verbose=False, archis=(64, ))
1170- #make_all(4, '', pyver='2.7', rootdir=r'D:\Winpython',
1171- # verbose=False, archis=(64, ), flavor='FlavorRfull')
1172- #make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
1189+ #make_all(3, '', pyver='3.4', rootdir=r'D:\Winpython',
11731190 # verbose=False, archis=(64, ), flavor='FlavorIgraph')
1174- #make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
1191+ #make_all(3 , '', pyver='3.4', rootdir=r'D:\Winpython',
11751192 # verbose=False, archis=(32, ), flavor='FlavorKivy')
1176- #make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
1193+ #make_all(3 , '', pyver='3.4', rootdir=r'D:\Winpython',
11771194 # verbose=False, archis=(32, ), flavor='FlavorRfull')
1178- #make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
1195+ #make_all(3 , '', pyver='3.4', rootdir=r'D:\Winpython',
11791196 # verbose=False, archis=(64, ), flavor='FlavorRfull')
1180- #make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
1197+ #make_all(3 , '', pyver='3.4', rootdir=r'D:\Winpython',
11811198 # verbose=False, archis=(32, ), flavor='FlavorJulia')
1182- #make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
1199+ #make_all(3 , '', pyver='3.4', rootdir=r'D:\Winpython',
11831200 # verbose=False, archis=(64, ), flavor='FlavorJulia')
1184- #make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
1201+ #make_all(3 , '', pyver='3.4', rootdir=r'D:\Winpython',
11851202 # verbose=False, archis=(32, ), flavor='FlavorRJulia')
0 commit comments