@@ -72,7 +72,7 @@ def build_7zip(srcname, dstname, data):
7272 ] + list (data )
7373 replace_in_7zip_file (dstname , data )
7474 try :
75- # insted of a 7zip command line, we launch a script that does it
75+ # instead of a 7zip command line, we launch a script that does it
7676 # retcode = subprocess.call(f'"{SEVENZIP_EXE}" "{dstname}"'),
7777 retcode = subprocess .call (
7878 f'"{ dstname } " ' ,
@@ -103,7 +103,6 @@ def __init__(
103103 wheeldir ,
104104 toolsdirs = None ,
105105 verbose = False ,
106- simulation = False ,
107106 basedir = None ,
108107 install_options = None ,
109108 flavor = "" ,
@@ -125,7 +124,6 @@ def __init__(
125124 self .winpydir = None # new WinPython BaseDirectory
126125 self .distribution = None
127126 self .installed_packages = []
128- self .simulation = simulation
129127 self .basedir = basedir # added to build from winpython
130128 self .install_options = install_options
131129 self .flavor = flavor
@@ -148,26 +146,14 @@ def package_index_wiki(self):
148146 installed_tools = []
149147
150148 def get_tool_path_file (relpath ):
151- if self .simulation :
152- for dirname in self .toolsdirs :
153- path = dirname + relpath .replace (r"\t" , "" )
154- if Path (path ).is_file ():
155- return path
156- else :
157- path = self .winpydir + relpath
158- if Path (path ).is_file ():
159- return path
149+ path = self .winpydir + relpath
150+ if Path (path ).is_file ():
151+ return path
160152
161153 def get_tool_path_dir (relpath ):
162- if self .simulation :
163- for dirname in self .toolsdirs :
164- path = dirname + relpath .replace (r"\t" , "" )
165- if Path (path ).is_dir ():
166- return path
167- else :
168- path = self .winpydir + relpath
169- if Path (path ).is_dir ():
170- return path
154+ path = self .winpydir + relpath
155+ if Path (path ).is_dir ():
156+ return path
171157
172158 juliapath = get_tool_path_dir (self .JULIA_PATH )
173159 if juliapath is not None :
@@ -1043,18 +1029,13 @@ def make(
10431029 remove_existing = True ,
10441030 requirements = None ,
10451031 my_winpydir = None ,
1046- ): # , find_links=None):
1032+ ):
10471033 """Make WinPython distribution in target directory from the installers
10481034 located in wheeldir
10491035
10501036 remove_existing=True: (default) install all from scratch
10511037 remove_existing=False: only for test purpose (launchers/scripts)
10521038 requirements=file(s) of requirements (separated by space if several)"""
1053- if self .simulation :
1054- print (
1055- "WARNING: this is just a simulation!" ,
1056- file = sys .stderr ,
1057- )
10581039 print (
10591040 self .python_fname ,
10601041 self .python_name ,
@@ -1066,14 +1047,14 @@ def make(
10661047 Path (self .target ) / my_winpydir
10671048 ) # Create/re-create the WinPython base directory
10681049 self ._print (f"Creating WinPython { my_winpydir } base directory" )
1069- if Path (self .winpydir ).is_dir () and remove_existing and not self . simulation :
1050+ if Path (self .winpydir ).is_dir () and remove_existing :
10701051 try :
10711052 shutil .rmtree (self .winpydir , onexc = utils .onerror )
10721053 except TypeError : # before 3.12
10731054 shutil .rmtree (self .winpydir , onerror = utils .onerror )
10741055 if not Path (self .winpydir ).is_dir ():
10751056 os .mkdir (self .winpydir )
1076- if remove_existing and not self . simulation :
1057+ if remove_existing :
10771058 # Create settings directory
10781059 # (only necessary if user is starting an application with a batch
10791060 # scripts before using an executable launcher, because the latter
@@ -1083,7 +1064,7 @@ def make(
10831064 os .mkdir (str (Path (self .winpydir ) / "settings" / "AppData" / "Roaming" ))
10841065 self ._print_done ()
10851066
1086- if remove_existing and not self . simulation :
1067+ if remove_existing :
10871068 self ._extract_python () # unzip Python interpreter
10881069 self .distribution = wppm .Distribution (
10891070 self .python_dir ,
@@ -1108,10 +1089,9 @@ def make(
11081089 )
11091090
11101091 if remove_existing :
1111- if not self .simulation :
1112- self ._create_batch_scripts_initial ()
1113- self ._create_batch_scripts ()
1114- self ._create_launchers ()
1092+ self ._create_batch_scripts_initial ()
1093+ self ._create_batch_scripts ()
1094+ self ._create_launchers ()
11151095 # PyPy must ensure pip via: "pypy3.exe -m ensurepip"
11161096 utils .python_execmodule ("ensurepip" , self .distribution .target )
11171097
@@ -1125,11 +1105,8 @@ def make(
11251105 self ._print (f"piping { ' ' .join (actions )} " )
11261106 self .distribution .do_pip_action (actions )
11271107 self .distribution .patch_standard_packages (req )
1128- print ("self.simulation:" , self .simulation )
1129- if not self .simulation :
1130- self ._copy_dev_tools ()
1131- self ._copy_dev_docs ()
1132- if not self .simulation :
1108+ self ._copy_dev_tools ()
1109+ self ._copy_dev_docs ()
11331110
11341111 if requirements :
11351112 if not list (requirements ) == requirements :
@@ -1143,7 +1120,7 @@ def make(
11431120 self .distribution .do_pip_action (actions )
11441121 self ._run_complement_batch_scripts ()
11451122 self .distribution .patch_standard_packages ()
1146- if remove_existing and not self . simulation :
1123+ if remove_existing :
11471124 self ._print ("Cleaning up distribution" )
11481125 self .distribution .clean_up ()
11491126 self ._print_done ()
@@ -1213,7 +1190,6 @@ def make_all(
12131190 verbose = False ,
12141191 remove_existing = True ,
12151192 create_installer = True ,
1216- simulation = False ,
12171193 install_options = ["--no-index" ],
12181194 flavor = "" ,
12191195 requirements = None ,
@@ -1280,7 +1256,6 @@ def make_all(
12801256 wheeldir ,
12811257 toolsdirs ,
12821258 verbose = verbose ,
1283- simulation = simulation ,
12841259 basedir = basedir ,
12851260 install_options = install_options + find_list ,
12861261 flavor = flavor ,
@@ -1321,14 +1296,13 @@ def make_all(
13211296 requirements = requirements ,
13221297 my_winpydir = my_winpydir ,
13231298 )
1324- # ,find_links=osp.join(basedir, 'packages.srcreq'))
1325- if str (create_installer ).lower () != "false" and not simulation :
1326- if "7zip" in str (create_installer ).lower ():
1327- dist .create_installer_7zip (".exe" )
1328- if ".7z" in str (create_installer ).lower ():
1329- dist .create_installer_7zip (".7z" )
1299+ if str (create_installer ).lower () != "false" :
13301300 if ".zip" in str (create_installer ).lower ():
13311301 dist .create_installer_7zip (".zip" )
1302+ if ".7z" in str (create_installer ).lower ():
1303+ dist .create_installer_7zip (".7z" )
1304+ if "7zip" in str (create_installer ).lower ():
1305+ dist .create_installer_7zip (".exe" )
13321306 return dist
13331307
13341308
0 commit comments