Skip to content

cosmetic shrink #1504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 8 additions & 37 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@


def find_7zip_executable() -> str:
"""
Locates the 7-Zip executable (7z.exe) in common installation directories.
"""
"Locates the 7-Zip executable (7z.exe)"
program_files_dirs = [
Path(r"C:\Program Files"),
Path(r"C:\Program Files (x86)"),
Expand Down Expand Up @@ -107,10 +105,10 @@ def build_installer_7zip(
except subprocess.CalledProcessError as e:
print(f"Error executing 7-Zip script: {e}", file=sys.stderr)


def _copy_items(source_dirs: list[Path], target_dir: Path, verbose: bool = False):
"""
Copies items from source directories to the target directory.
"""
"Copies items from source directories to the target directory."

target_dir.mkdir(parents=True, exist_ok=True)
for source_dir in source_dirs:
if not source_dir.is_dir():
Expand All @@ -128,9 +126,7 @@ def _copy_items(source_dirs: list[Path], target_dir: Path, verbose: bool = False
print(f"Error copying {source_item} to {target_item}: {e}")

class WinPythonDistributionBuilder:
"""
Builds a WinPython distribution.
"""
"Builds a WinPython distribution."

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

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

def _get_python_zip_file(self) -> Path:
"""
Finds the Python zip file in the wheels directory.

Returns:
Path: Path to the Python zip file.
Raises:
RuntimeError: if no python zip file is found
"""
"Finds the Python .zip file in the wheels directory."
patterns = [
r"(pypy3|python-)([0-9]|[a-zA-Z]|.)*.zip", # PyPy pattern
r"python-([0-9\.rcba]*)((\.|\-)amd64)?\.(zip|zip)", # Standard Python pattern
Expand Down Expand Up @@ -739,27 +728,9 @@ def make_all(
my_x = my_x[:-1]
# simplify for PyPy
if not python_target_release == None:
winpy_dirname = (
"WPy"
+ f"{architecture}"
+ "-"
+ python_target_release
+ ""
+ f"{build_number}"
) + release_level
# + flavor
winpy_dirname = f"WPy{architecture}-{python_target_release}{build_number}{release_level}"
else:
winpy_dirname = (
"WPy"
+ f"{architecture}"
+ "-"
+ pyver.replace(".", "")
+ ""
+ my_x
+ ""
+ f"{build_number}"
) + release_level
# + flavor
winpy_dirname = f"WPy{architecture}-{pyver.replace('.', '')}{my_x}{build_number}{release_level}"

builder.build(
remove_existing=remove_existing,
Expand Down