2323assert CHANGELOGS_DIRECTORY .is_dir (), f"Changelogs directory not found: { CHANGELOGS_DIRECTORY } "
2424assert PORTABLE_DIRECTORY .is_dir (), f"Portable directory not found: { PORTABLE_DIRECTORY } "
2525
26- def find_7zip_executable () -> str :
27- """Locates the 7-Zip executable (7z.exe)."""
28- possible_program_files = [r"C:\Program Files" , r"C:\Program Files (x86)" , Path (sys .prefix ).parent / "t" ]
29- for base_dir in possible_program_files :
30- if (executable_path := Path (base_dir ) / "7-Zip" / "7z.exe" ).is_file ():
31- return str (executable_path )
32- raise RuntimeError ("7ZIP is not installed on this computer." )
33-
3426def copy_items (source_directories : list [Path ], target_directory : Path , verbose : bool = False ):
3527 """Copies items from source directories to the target directory."""
3628 target_directory .mkdir (parents = True , exist_ok = True )
@@ -138,7 +130,7 @@ def create_installer_7zip(self, installer_type: str = "exe", compression= "mx5")
138130 sfx_option = "-sfx7z.sfx" if installer_type == "exe" else ""
139131 zip_option = "-tzip" if installer_type == "zip" else ""
140132 compress_level = "mx5" if compression == "" else compression
141- command = f'"{ find_7zip_executable ()} " { zip_option } -{ compress_level } a "{ fullfilename } " "{ DISTDIR } " { sfx_option } '
133+ command = f'"{ utils . find_7zip_executable ()} " { zip_option } -{ compress_level } a "{ fullfilename } " "{ DISTDIR } " { sfx_option } '
142134 print (f'Executing 7-Zip script: "{ command } "' )
143135 try :
144136 subprocess .run (command , shell = True , check = True , stderr = sys .stderr , stdout = sys .stderr )
@@ -224,7 +216,6 @@ def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,
224216 verbose : bool = False , rebuild : bool = True , create_installer : str = "True" , install_options = ["--no-index" ],
225217 flavor : str = "" , find_links : str | list [Path ] = None ,
226218 source_dirs : Path = None , toolsdirs : str | list [Path ] = None ,
227- python_target_release : str = None , # e.g. "37101" for 3.7.10
228219):
229220 """
230221 Make a WinPython distribution for a given set of parameters:
@@ -240,7 +231,6 @@ def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,
240231 find_links: package directories (r'D:\Winpython\packages.srcreq')
241232 source_dirs: the python.zip + rebuilt winpython wheel package directory
242233 toolsdirs: Directory with development tools r'D:\WinPython\b asedir34\t .Slim'
243- python_target_release: Target Python release (str).
244234 """
245235 assert basedir_wpy is not None , "The *winpython_dirname* directory must be specified"
246236
@@ -261,10 +251,6 @@ def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,
261251 install_options = install_options_list + find_links_options ,
262252 flavor = flavor
263253 )
264- # define the directory where to create the distro
265- python_minor_version_str = "" .join (builder .python_name .replace (".amd64" , "" ).split ("." )[- 2 :- 1 ])
266- while not python_minor_version_str .isdigit () and len (python_minor_version_str ) > 0 :
267- python_minor_version_str = python_minor_version_str [:- 1 ]
268254
269255 builder .build (rebuild = rebuild , winpy_dir = winpy_dir )
270256
0 commit comments