@@ -158,9 +158,8 @@ def __init__(
158158 self .verbose = verbose
159159 self .winpy_dir : Path | None = None # Will be set during build
160160 self .distribution : wppm .Distribution | None = None # Will be set during build
161- self .installed_packages = []
162161 self .base_dir = base_dir
163- self .install_options = install_options
162+ self .install_options = install_options or []
164163 self .flavor = flavor
165164 self .python_zip_file : Path = self ._get_python_zip_file ()
166165 self .python_name = self .python_zip_file .stem # Filename without extension
@@ -266,10 +265,10 @@ def _get_installed_packages_markdown(self) -> str:
266265 ]
267266 return "\n " .join (package_lines )
268267
269- # @property makes self.winpython_version_name becomes a call to self.winpython_version_name()
268+
270269 @property
271- def winpython_version_name (self ):
272- """Return WinPython version (with flavor and release level!) """
270+ def winpython_version_name (self ) -> str :
271+ """Returns the full WinPython version string. """
273272 return f"{ self .python_full_version } .{ self .build_number } { self .flavor } { self .release_level } "
274273
275274 @property
@@ -497,13 +496,13 @@ def _copy_documentation(self):
497496
498497
499498 def _create_launchers (self ):
500- """Create launchers"""
499+ """Copies pre-made launchers to the WinPython directory. """
501500 self ._print_action ("Creating launchers" )
502- # 2025-01-04: copy launchers premade per the Datalab-Python way
503501 launchers_source_dir = PORTABLE_DIR / "launchers_final"
504502 for item in launchers_source_dir .rglob ('*.exe' ):
505503 shutil .copy2 (item , self .winpy_dir )
506- print ("new way !!!!!!!!!!!!!!!!!! " , item , " -> " ,self .winpy_dir )
504+ if self .verbose :
505+ print (f" Copied launcher: { item .name } -> { self .winpy_dir } " )
507506 for item in launchers_source_dir .rglob ('licence*.*' ):
508507 shutil .copy2 (item , self .winpy_dir )
509508 self ._print_action_done ()
@@ -683,7 +682,6 @@ def _create_initial_batch_scripts(self):
683682 self .create_batch_script ("env_for_icons.bat" , env_for_icons_bat_content , replacements = batch_replacements )
684683
685684
686- # Replaces winpython.vbs, and a bit of env.bat
687685 winpython_ini_py_content = r"""
688686# Prepares a dynamic list of variables settings from a .ini file
689687import os
@@ -986,7 +984,7 @@ def _run_complementary_batch_scripts(self, script_name="run_complement.bat"):
986984 self ._print_action_done ()
987985
988986
989- def make (
987+ def build (
990988 self ,
991989 remove_existing = True ,
992990 requirements = None ,
@@ -1025,17 +1023,6 @@ def make(
10251023 indent = True ,
10261024 )
10271025
1028- # Assert that WinPython version and real python version do match
1029- self ._print_action (
1030- f"Python version{ self .python_full_version .replace ('.' ,'' )} "
1031- + f"\n Distro Name { self .distribution .target } "
1032- )
1033- assert self .python_full_version .replace ("." , "" ) in self .distribution .target , (
1034- "Distro Directory doesn't match the Python version it ships"
1035- + f"\n Python version: { self .python_full_version .replace ('.' ,'' )} "
1036- + f"\n Distro Name: { self .distribution .target } "
1037- )
1038-
10391026 if remove_existing :
10401027 self ._create_initial_batch_scripts ()
10411028 self ._create_standard_batch_scripts ()
@@ -1232,7 +1219,7 @@ def make_all(
12321219 ) + release_level
12331220 # + flavor
12341221
1235- builder .make (
1222+ builder .build (
12361223 remove_existing = remove_existing ,
12371224 requirements = requirements_files_list ,
12381225 my_winpydir = my_winpydir ,
@@ -1244,6 +1231,7 @@ def make_all(
12441231 builder .create_installer_7zip (".7z" )
12451232 if "7zip" in str (create_installer ).lower ():
12461233 builder .create_installer_7zip (".exe" )
1234+
12471235 return builder
12481236
12491237
0 commit comments