29
29
30
30
31
31
def find_7zip_executable () -> str :
32
- """
33
- Locates the 7-Zip executable (7z.exe) in common installation directories.
34
- """
32
+ "Locates the 7-Zip executable (7z.exe)"
35
33
program_files_dirs = [
36
34
Path (r"C:\Program Files" ),
37
35
Path (r"C:\Program Files (x86)" ),
@@ -107,10 +105,10 @@ def build_installer_7zip(
107
105
except subprocess .CalledProcessError as e :
108
106
print (f"Error executing 7-Zip script: { e } " , file = sys .stderr )
109
107
108
+
110
109
def _copy_items (source_dirs : list [Path ], target_dir : Path , verbose : bool = False ):
111
- """
112
- Copies items from source directories to the target directory.
113
- """
110
+ "Copies items from source directories to the target directory."
111
+
114
112
target_dir .mkdir (parents = True , exist_ok = True )
115
113
for source_dir in source_dirs :
116
114
if not source_dir .is_dir ():
@@ -128,9 +126,7 @@ def _copy_items(source_dirs: list[Path], target_dir: Path, verbose: bool = False
128
126
print (f"Error copying { source_item } to { target_item } : { e } " )
129
127
130
128
class WinPythonDistributionBuilder :
131
- """
132
- Builds a WinPython distribution.
133
- """
129
+ "Builds a WinPython distribution."
134
130
135
131
NODEJS_PATH_REL = r"\n" # Relative path within WinPython dir
136
132
@@ -179,14 +175,7 @@ def __init__(
179
175
self .python_dir_name = "python" # Standardized Python directory name
180
176
181
177
def _get_python_zip_file (self ) -> Path :
182
- """
183
- Finds the Python zip file in the wheels directory.
184
-
185
- Returns:
186
- Path: Path to the Python zip file.
187
- Raises:
188
- RuntimeError: if no python zip file is found
189
- """
178
+ "Finds the Python .zip file in the wheels directory."
190
179
patterns = [
191
180
r"(pypy3|python-)([0-9]|[a-zA-Z]|.)*.zip" , # PyPy pattern
192
181
r"python-([0-9\.rcba]*)((\.|\-)amd64)?\.(zip|zip)" , # Standard Python pattern
@@ -739,27 +728,9 @@ def make_all(
739
728
my_x = my_x [:- 1 ]
740
729
# simplify for PyPy
741
730
if not python_target_release == None :
742
- winpy_dirname = (
743
- "WPy"
744
- + f"{ architecture } "
745
- + "-"
746
- + python_target_release
747
- + ""
748
- + f"{ build_number } "
749
- ) + release_level
750
- # + flavor
731
+ winpy_dirname = f"WPy{ architecture } -{ python_target_release } { build_number } { release_level } "
751
732
else :
752
- winpy_dirname = (
753
- "WPy"
754
- + f"{ architecture } "
755
- + "-"
756
- + pyver .replace ("." , "" )
757
- + ""
758
- + my_x
759
- + ""
760
- + f"{ build_number } "
761
- ) + release_level
762
- # + flavor
733
+ winpy_dirname = f"WPy{ architecture } -{ pyver .replace ('.' , '' )} { my_x } { build_number } { release_level } "
763
734
764
735
builder .build (
765
736
remove_existing = remove_existing ,
0 commit comments