@@ -621,7 +621,7 @@ def _create_batch_scripts(self):
621621
622622The purpose of these files is to help the user writing his/her own
623623batch file to call Python scripts inside WinPython.
624- The examples here ('spyder.bat', 'spyder_light.bat', 'wppm .bat',
624+ The examples here ('spyder.bat', 'spyder_light.bat', 'wpcp .bat',
625625'pyqt_demo.bat', 'python.bat' and 'cmd.bat') are quite similar to the
626626launchers located in the parent directory.
627627The environment variables are set-up in 'env.bat'.""" )
@@ -710,12 +710,13 @@ def _run_complement_batch_scripts(self, this_batch="run_complement.bat"):
710710
711711 self ._print_done ()
712712
713- def make (self , remove_existing = True ):
713+ def make (self , remove_existing = True , requirements = None ): #, find_links=None ):
714714 """Make WinPython distribution in target directory from the installers
715715 located in wheeldir
716716
717717 remove_existing=True: (default) install all from scratch
718- remove_existing=False: only for test purpose (launchers/scripts)"""
718+ remove_existing=False: only for test purpose (launchers/scripts)
719+ requirements=file(s) of requirements (separated by space if several)"""
719720 if self .simulation :
720721 print ("WARNING: this is just a simulation!" , file = sys .stderr )
721722
@@ -766,6 +767,21 @@ def make(self, remove_existing=True):
766767 self ._copy_dev_tools ()
767768 self ._copy_dev_docs ()
768769 if not self .simulation :
770+
771+ if requirements :
772+ if not list (requirements )== requirements :
773+ requirements = requirements .split ()
774+ for req in requirements :
775+ actions = ["install" ,"-r" , req ]
776+ if self .install_options is not None :
777+ actions += self .install_options
778+ print ("piping %s" % ' ' .join (actions ))
779+ self ._print ("piping %s" % ' ' .join (actions ))
780+ self .distribution .do_pip_action (actions )
781+ #actions=["install","-r", req, "--no-index",
782+ # "--trusted-host=None"]+ links,
783+ # install_options=None)
784+
769785 self ._run_complement_batch_scripts () # run_complement.bat
770786 self .distribution .patch_standard_packages ()
771787 # launchers at the very end
@@ -808,7 +824,8 @@ def rebuild_winpython(basedir=None, verbose=False, archis=(32, 64)):
808824def make_winpython (build_number , release_level , architecture ,
809825 basedir = None , verbose = False , remove_existing = True ,
810826 create_installer = True , simulation = False , rootdir = None ,
811- install_options = None , flavor = '' ):
827+ install_options = None , flavor = '' , requirements = None ,
828+ find_links = None ):
812829 """Make WinPython distribution, for a given base directory and
813830 architecture:
814831
@@ -880,15 +897,21 @@ def make_winpython(build_number, release_level, architecture,
880897 if osp .isdir (flavor_docs ):
881898 docsdirs .append (flavor_docs )
882899
883- install_options = ['--no-index' , '--pre' , '--find-links=%s' % wheeldir ]
900+ # install_options = ['--no-index', '--pre', '--find-links=%s' % wheeldir]
884901
902+ if find_links is None :
903+ find_links = ''
904+ if not find_links == list (find_links ):
905+ find_links = find_links .split ()
906+ find_list = ['--find-links=%s' % l for l in find_links + [wheeldir ]]
885907 dist = WinPythonDistribution (build_number , release_level ,
886908 builddir , wheeldir , toolsdirs ,
887909 verbose = verbose , simulation = simulation ,
888910 rootdir = rootdir ,
889- install_options = install_options ,
911+ install_options = install_options + find_list ,
890912 flavor = flavor , docsdirs = docsdirs )
891- dist .make (remove_existing = remove_existing )
913+ dist .make (remove_existing = remove_existing , requirements = requirements )
914+ # ,find_links=osp.join(basedir, 'packages.srcreq'))
892915 if create_installer and not simulation :
893916 dist .create_installer ()
894917 return dist
@@ -897,7 +920,8 @@ def make_winpython(build_number, release_level, architecture,
897920def make_all (build_number , release_level , pyver ,
898921 rootdir = None , simulation = False , create_installer = True ,
899922 verbose = False , remove_existing = True , archis = (32 , 64 ),
900- install_options = ['--no-index' ], flavor = '' ):
923+ install_options = ['--no-index' ], flavor = '' , requirements = None ,
924+ find_links = None ):
901925 """Make WinPython for both 32 and 64bit architectures:
902926
903927 make_all(build_number, release_level, pyver, rootdir, simulation=False,
@@ -909,26 +933,31 @@ def make_all(build_number, release_level, pyver,
909933 `rootdir`: [str] if None, WINPYTHONROOTDIR env var must be set
910934 (rootdir: root directory containing 'basedir27', 'basedir33', etc.)
911935 """ + utils .ROOTDIR_DOC
936+
937+ if install_options :
938+ if not list (install_options ) == install_options :
939+ install_options = install_options .split ()
940+ print ('install_options' , install_options )
912941 basedir = utils .get_basedir (pyver , rootdir = rootdir )
913942 rebuild_winpython (basedir = basedir , archis = archis )
914943 for architecture in archis :
915944 make_winpython (build_number , release_level , architecture , basedir ,
916945 verbose , remove_existing , create_installer , simulation ,
917946 rootdir = rootdir , install_options = install_options ,
918- flavor = flavor )
947+ flavor = flavor , requirements = requirements ,
948+ find_links = find_links )
919949
920950
921951if __name__ == '__main__' :
922952 # DO create only one version at a time
923953 # You may have to manually delete previous build\winpython-.. directory
924954
925- #make_all(4, '', pyver='3.4', rootdir=r'D:\Winpython',
926- # verbose=False, archis=(32, ))
927- #make_all(4, '', pyver='3.4', rootdir=r'D:\Winpython',
928- # verbose=False, archis=(64, ), flavor='')
929- make_all (4 , '' , pyver = '3.4' , rootdir = r'D:\WinpythonQt5' ,
930- verbose = False , archis = (64 , ))
955+ #make_all(6, '', pyver='3.4', rootdir=r'D:\WinpythonQt5',
956+ # verbose=False, archis=(64, ))
931957 #make_all(1, '', pyver='2.7', rootdir=r'D:\Winpython',
932958 # verbose=False, archis=(64, ))
933- #make_all(4, '', pyver='3.4', rootdir=r'D:\Winpython',
934- # verbose=False, archis=(64, ), flavor='FlavorJulia')
959+ make_all (6 , '' , pyver = '3.4' , rootdir = r'D:\Winpython' , verbose = True ,
960+ archis = (64 , ), flavor = '' ,
961+ requirements = r'D:\Winpython\basedir34\requirements.txt D:\Winpython\basedir34\requirements2.txt D:\Winpython\basedir34\requirements3.txt' ,
962+ install_options = r'--no-index --pre --trusted-host=None' ,
963+ find_links = r'D:\Winpython\basedir34\packages.srcreq' )
0 commit comments