@@ -130,7 +130,7 @@ class WinPythonDistribution(object):
130130
131131 def __init__ (self , build_number , release_level , target , instdir ,
132132 srcdir = None , toolsdirs = None , verbose = False , simulation = False ,
133- rootdir = None ):
133+ rootdir = None , install_options = None ):
134134 assert isinstance (build_number , int )
135135 assert isinstance (release_level , str )
136136 self .build_number = build_number
@@ -151,6 +151,7 @@ def __init__(self, build_number, release_level, target, instdir,
151151 self .installed_packages = []
152152 self .simulation = simulation
153153 self .rootdir = rootdir # addded to build from winpython
154+ self .install_options = install_options
154155
155156 @property
156157 def package_index_wiki (self ):
@@ -281,7 +282,8 @@ def install_package(self, pattern):
281282 self .distribution ._print (pack , "Installing" )
282283 self .distribution ._print_done ()
283284 else :
284- self .distribution .install (pack )
285+ self .distribution .install (pack ,
286+ install_options = self .install_options )
285287 self .installed_packages .append (pack )
286288
287289 def create_batch_script (self , name , contents ):
@@ -432,8 +434,11 @@ def _install_required_packages(self):
432434 % (self .py_arch , self .python_version ))
433435 self .install_package ('setuptools-([0-9\.]*[a-z]*[0-9]?).%s(-py%s)?.exe'
434436 % (self .py_arch , self .python_version ))
435- self .install_package ('winpython-([0-9\.]*[a-z]*[0-9]?).%s(-py%s)?.exe'
437+ # Install First these two packages to support wheel format
438+ self .install_package ('pip-([0-9\.]*[a-z]*[0-9]?).%s(-py%s)?.exe'
436439 % (self .py_arch , self .python_version ))
440+ self .install_package ('wheel-([0-9\.]*[a-z]*[0-9]?).tar.gz' )
441+
437442 self .install_package ('spyder(lib)?-([0-9\.]*[a-z]*[0-9]?).%s(-py%s)?.exe'
438443 % (self .py_arch , self .python_version ))
439444 # PyQt module is now like :PyQt4-4.10.4-gpl-Py3.4-Qt4.8.6-x32.exe
@@ -442,6 +447,12 @@ def _install_required_packages(self):
442447 self .install_package (
443448 pattern = 'PyQwt-([0-9\.]*)-py%s-%s-([a-z0-9\.\-]*).exe'
444449 % (self .python_version , self .pyqt_arch ))
450+
451+ # Install 'main packages' first (was before Wheel idea, keep for now)
452+ for happy_few in ['numpy-MKL' , 'scipy' , 'matplotlib' , 'pandas' ]:
453+ self .install_package (
454+ pattern = '%s-([0-9\.]*[a-z]*[0-9]?).%s(-py%s)?.exe'
455+ % (happy_few , self .py_arch , self .python_version ))
445456
446457 def _install_all_other_packages (self ):
447458 """Try to install all other packages in instdir"""
@@ -798,7 +809,8 @@ def rebuild_winpython(basedir=None, verbose=False, archis=(32, 64)):
798809
799810def make_winpython (build_number , release_level , architecture ,
800811 basedir = None , verbose = False , remove_existing = True ,
801- create_installer = True , simulation = False , rootdir = None ):
812+ create_installer = True , simulation = False , rootdir = None ,
813+ install_options = None ):
802814 """Make WinPython distribution, for a given base directory and
803815 architecture:
804816
@@ -833,15 +845,16 @@ def make_winpython(build_number, release_level, architecture,
833845 dist = WinPythonDistribution (build_number , release_level ,
834846 builddir , packdir , srcdir , toolsdirs ,
835847 verbose = verbose , simulation = simulation ,
836- rootdir = rootdir )
848+ rootdir = rootdir , install_options = install_options )
837849 dist .make (remove_existing = remove_existing )
838850 if create_installer and not simulation :
839851 dist .create_installer ()
840852 return dist
841853
842854def make_all (build_number , release_level , pyver ,
843855 rootdir = None , simulation = False , create_installer = True ,
844- verbose = False , remove_existing = True , archis = (32 , 64 )):
856+ verbose = False , remove_existing = True , archis = (32 , 64 ),
857+ install_options = ['--no-deps' ]):
845858 """Make WinPython for both 32 and 64bit architectures:
846859
847860 make_all(build_number, release_level, pyver, rootdir, simulation=False,
@@ -858,22 +871,22 @@ def make_all(build_number, release_level, pyver,
858871 for architecture in archis :
859872 make_winpython (build_number , release_level , architecture , basedir ,
860873 verbose , remove_existing , create_installer , simulation ,
861- rootdir = rootdir )
874+ rootdir = rootdir , install_options = install_options )
862875
863876
864877if __name__ == '__main__' :
865878 # DO create only what version at a time
866879 # You may have to manually delete previous build\winpython-.. directory
867880
868- make_all (1 , '' , pyver = '3.4' , rootdir = r'D:\Winpython' ,
869- verbose = True , archis = (32 , )) #64))
870- #make_all(1 , '', pyver='3.4', rootdir=r'D:\Winpython',
871- # verbose=True , archis=(64, )) #64))
872- #make_all(1 , '', pyver='3.3', rootdir=r'D:\Winpython',
873- # verbose=True , archis=(32, )) #64))
874- #make_all(1 , '', pyver='3.3', rootdir=r'D:\Winpython',
875- # verbose=True , archis=(64, )) #64))
876- #make_all(1 , '', pyver='2.7', rootdir=r'D:\Winpython',
877- # verbose=True , archis=(32, )) #64))
878- #make_all(1 , '', pyver='2.7', rootdir=r'D:\Winpython',
879- # verbose=True , archis=(64, )) #64))
881+ make_all (2 , '' , pyver = '3.4' , rootdir = r'D:\Winpython' ,
882+ verbose = False , archis = (32 , )) #64))
883+ #make_all(2 , '', pyver='3.4', rootdir=r'D:\Winpython',
884+ # verbose=False , archis=(64, )) #64))
885+ #make_all(2 , '', pyver='3.3', rootdir=r'D:\Winpython',
886+ # verbose=False , archis=(32, )) #64))
887+ #make_all(2 , '', pyver='3.3', rootdir=r'D:\Winpython',
888+ # verbose=False , archis=(64, )) #64))
889+ #make_all(2 , '', pyver='2.7', rootdir=r'D:\Winpython',
890+ # verbose=False , archis=(32, )) #64))
891+ #make_all(2 , '', pyver='2.7', rootdir=r'D:\Winpython',
892+ # verbose=False , archis=(64, )) #64))
0 commit comments