Skip to content

Commit d45aed0

Browse files
authored
Merge pull request #1504 from stonebig/master
cosmetic shrink
2 parents 02d5f86 + 6c93890 commit d45aed0

File tree

1 file changed

+8
-37
lines changed

1 file changed

+8
-37
lines changed

make.py

+8-37
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929

3030

3131
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)"
3533
program_files_dirs = [
3634
Path(r"C:\Program Files"),
3735
Path(r"C:\Program Files (x86)"),
@@ -107,10 +105,10 @@ def build_installer_7zip(
107105
except subprocess.CalledProcessError as e:
108106
print(f"Error executing 7-Zip script: {e}", file=sys.stderr)
109107

108+
110109
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+
114112
target_dir.mkdir(parents=True, exist_ok=True)
115113
for source_dir in source_dirs:
116114
if not source_dir.is_dir():
@@ -128,9 +126,7 @@ def _copy_items(source_dirs: list[Path], target_dir: Path, verbose: bool = False
128126
print(f"Error copying {source_item} to {target_item}: {e}")
129127

130128
class WinPythonDistributionBuilder:
131-
"""
132-
Builds a WinPython distribution.
133-
"""
129+
"Builds a WinPython distribution."
134130

135131
NODEJS_PATH_REL = r"\n" # Relative path within WinPython dir
136132

@@ -179,14 +175,7 @@ def __init__(
179175
self.python_dir_name = "python" # Standardized Python directory name
180176

181177
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."
190179
patterns = [
191180
r"(pypy3|python-)([0-9]|[a-zA-Z]|.)*.zip", # PyPy pattern
192181
r"python-([0-9\.rcba]*)((\.|\-)amd64)?\.(zip|zip)", # Standard Python pattern
@@ -739,27 +728,9 @@ def make_all(
739728
my_x = my_x[:-1]
740729
# simplify for PyPy
741730
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}"
751732
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}"
763734

764735
builder.build(
765736
remove_existing=remove_existing,

0 commit comments

Comments
 (0)