23
23
assert CHANGELOGS_DIRECTORY .is_dir (), f"Changelogs directory not found: { CHANGELOGS_DIRECTORY } "
24
24
assert PORTABLE_DIRECTORY .is_dir (), f"Portable directory not found: { PORTABLE_DIRECTORY } "
25
25
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
-
34
26
def copy_items (source_directories : list [Path ], target_directory : Path , verbose : bool = False ):
35
27
"""Copies items from source directories to the target directory."""
36
28
target_directory .mkdir (parents = True , exist_ok = True )
@@ -138,7 +130,7 @@ def create_installer_7zip(self, installer_type: str = "exe", compression= "mx5")
138
130
sfx_option = "-sfx7z.sfx" if installer_type == "exe" else ""
139
131
zip_option = "-tzip" if installer_type == "zip" else ""
140
132
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 } '
142
134
print (f'Executing 7-Zip script: "{ command } "' )
143
135
try :
144
136
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,
224
216
verbose : bool = False , rebuild : bool = True , create_installer : str = "True" , install_options = ["--no-index" ],
225
217
flavor : str = "" , find_links : str | list [Path ] = None ,
226
218
source_dirs : Path = None , toolsdirs : str | list [Path ] = None ,
227
- python_target_release : str = None , # e.g. "37101" for 3.7.10
228
219
):
229
220
"""
230
221
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,
240
231
find_links: package directories (r'D:\Winpython\packages.srcreq')
241
232
source_dirs: the python.zip + rebuilt winpython wheel package directory
242
233
toolsdirs: Directory with development tools r'D:\WinPython\b asedir34\t .Slim'
243
- python_target_release: Target Python release (str).
244
234
"""
245
235
assert basedir_wpy is not None , "The *winpython_dirname* directory must be specified"
246
236
@@ -261,10 +251,6 @@ def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,
261
251
install_options = install_options_list + find_links_options ,
262
252
flavor = flavor
263
253
)
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 ]
268
254
269
255
builder .build (rebuild = rebuild , winpy_dir = winpy_dir )
270
256
0 commit comments