55from pathlib import Path
66from filecmp import cmp
77
8- LOG_FORMAT = "%(asctime)s %(levelname)s: %(message)s"
9-
10- def setup_logging (log_file : Path ):
8+ def setup_logging (log_file : Path , LOG_FORMAT = "%(asctime)s %(levelname)s: %(message)s" ):
119 """Initialize logging to both file and stdout."""
1210 logging .basicConfig (
1311 level = logging .INFO ,
@@ -18,10 +16,10 @@ def setup_logging(log_file: Path):
1816 ]
1917 )
2018
21- def log_section (message : str ):
22- logging .info ("\n " + "-" * 40 )
19+ def log_section (message : str , highlight_bar = "-" * 40 ):
20+ logging .info ("\n " + highlight_bar )
2321 logging .info (message )
24- logging .info ("-" * 40 )
22+ logging .info (highlight_bar )
2523
2624def delete_folder_if_exists (folder : Path , check_flavor : str = "" ):
2725 check_last = folder .parent .name if not folder .is_dir () else folder .name
@@ -76,8 +74,8 @@ def generate_lockfiles(target_python: Path, winpydirbase: Path, constraints: str
7674 pip_req .write_bytes (b"" .join (packages ))
7775 # Lock to web and local (scaffolding)
7876 for kind in ("" , "local" ):
79- out = winpydirbase .parent / f"pylock.{ file_postfix } _ { kind } .toml"
80- outreq = winpydirbase .parent / f"requir.{ file_postfix } _ { kind } .txt"
77+ out = winpydirbase .parent / f"pylock.{ file_postfix } { kind } .toml"
78+ outreq = winpydirbase .parent / f"requir.{ file_postfix } { kind } .txt"
8179 cmd = [str (target_python ), "-m" , "pip" , "lock" , "--no-deps" , "-c" , constraints ]
8280 if kind == "local" :
8381 cmd += ["--find-links" , find_links ]
@@ -88,11 +86,11 @@ def generate_lockfiles(target_python: Path, winpydirbase: Path, constraints: str
8886 run_command (cmd )
8987 # check equality
9088 web , local = "" , "local"
91- if not cmp (winpydirbase .parent / f"requir.{ file_postfix } _ { web } .txt" , winpydirbase .parent / f"requir.{ file_postfix } _ { local } .txt" ):
92- print ("⚠️⚠️⚠️⚠️⚠️⚠️ ALARM ⚠️⚠️⚠️⚠️⚠️⚠️differences in " , winpydirbase .parent / f"requir.{ file_postfix } _ { web } .txt" , winpydirbase .parent / f"requir.{ file_postfix } _ { local } .txt" )
89+ if not cmp (winpydirbase .parent / f"requir.{ file_postfix } { web } .txt" , winpydirbase .parent / f"requir.{ file_postfix } { local } .txt" ):
90+ print ("⚠️⚠️⚠️⚠️⚠️⚠️ ALARM ⚠️⚠️⚠️⚠️⚠️⚠️differences in " , winpydirbase .parent / f"requir.{ file_postfix } { web } .txt" , winpydirbase .parent / f"requir.{ file_postfix } { local } .txt" )
9391 raise os .error
9492 else :
95- print ("💖💖💖 match 💖💖💖 ok " ,winpydirbase .parent / f"requir.{ file_postfix } _ { web } .txt" , winpydirbase .parent / f"requir.{ file_postfix } _ { local } .txt" )
93+ print ("💖💖💖 match 💖💖💖 ok " ,winpydirbase .parent / f"requir.{ file_postfix } { web } .txt" , winpydirbase .parent / f"requir.{ file_postfix } { local } .txt" )
9694
9795# --- Main Logic ---
9896def run_make_py (build_python , winpydirbase , args ):
@@ -114,7 +112,7 @@ def process_wheelhouse_requirements(target_python: Path, winpydirbase: Path,args
114112 if wheelhousereq .is_file ():
115113 # Generate pylock from wheelhousereq
116114 cmd = [
117- str (target_python ), "-m" , "pip" , "lock" , "--no-index" , "--trusted-host=None" ,
115+ str (target_python ), "-m" , "pip" , "lock" , "--no-index" , "--trusted-host=None" , "--pre" ,
118116 "--find-links" , args .find_links , "-c" , args .constraints , "-r" , str (wheelhousereq ),
119117 "-o" , str (out )
120118 ]
0 commit comments