@@ -158,9 +158,8 @@ def __init__(
158
158
self .verbose = verbose
159
159
self .winpy_dir : Path | None = None # Will be set during build
160
160
self .distribution : wppm .Distribution | None = None # Will be set during build
161
- self .installed_packages = []
162
161
self .base_dir = base_dir
163
- self .install_options = install_options
162
+ self .install_options = install_options or []
164
163
self .flavor = flavor
165
164
self .python_zip_file : Path = self ._get_python_zip_file ()
166
165
self .python_name = self .python_zip_file .stem # Filename without extension
@@ -266,10 +265,10 @@ def _get_installed_packages_markdown(self) -> str:
266
265
]
267
266
return "\n " .join (package_lines )
268
267
269
- # @property makes self.winpython_version_name becomes a call to self.winpython_version_name()
268
+
270
269
@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. """
273
272
return f"{ self .python_full_version } .{ self .build_number } { self .flavor } { self .release_level } "
274
273
275
274
@property
@@ -497,13 +496,13 @@ def _copy_documentation(self):
497
496
498
497
499
498
def _create_launchers (self ):
500
- """Create launchers"""
499
+ """Copies pre-made launchers to the WinPython directory. """
501
500
self ._print_action ("Creating launchers" )
502
- # 2025-01-04: copy launchers premade per the Datalab-Python way
503
501
launchers_source_dir = PORTABLE_DIR / "launchers_final"
504
502
for item in launchers_source_dir .rglob ('*.exe' ):
505
503
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 } " )
507
506
for item in launchers_source_dir .rglob ('licence*.*' ):
508
507
shutil .copy2 (item , self .winpy_dir )
509
508
self ._print_action_done ()
@@ -683,7 +682,6 @@ def _create_initial_batch_scripts(self):
683
682
self .create_batch_script ("env_for_icons.bat" , env_for_icons_bat_content , replacements = batch_replacements )
684
683
685
684
686
- # Replaces winpython.vbs, and a bit of env.bat
687
685
winpython_ini_py_content = r"""
688
686
# Prepares a dynamic list of variables settings from a .ini file
689
687
import os
@@ -986,7 +984,7 @@ def _run_complementary_batch_scripts(self, script_name="run_complement.bat"):
986
984
self ._print_action_done ()
987
985
988
986
989
- def make (
987
+ def build (
990
988
self ,
991
989
remove_existing = True ,
992
990
requirements = None ,
@@ -1025,17 +1023,6 @@ def make(
1025
1023
indent = True ,
1026
1024
)
1027
1025
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
-
1039
1026
if remove_existing :
1040
1027
self ._create_initial_batch_scripts ()
1041
1028
self ._create_standard_batch_scripts ()
@@ -1232,7 +1219,7 @@ def make_all(
1232
1219
) + release_level
1233
1220
# + flavor
1234
1221
1235
- builder .make (
1222
+ builder .build (
1236
1223
remove_existing = remove_existing ,
1237
1224
requirements = requirements_files_list ,
1238
1225
my_winpydir = my_winpydir ,
@@ -1244,6 +1231,7 @@ def make_all(
1244
1231
builder .create_installer_7zip (".7z" )
1245
1232
if "7zip" in str (create_installer ).lower ():
1246
1233
builder .create_installer_7zip (".exe" )
1234
+
1247
1235
return builder
1248
1236
1249
1237
0 commit comments