@@ -290,6 +290,12 @@ def make_build_python(context, working_dir):
290290 print (f"🎉 { binary } { version } " )
291291
292292
293+ @subdir ("native_build_dir" )
294+ def pythoninfo_build (context , working_dir ):
295+ """Display build info for the build Python."""
296+ call (["make" , "pythoninfo" ], quiet = context .quiet )
297+
298+
293299def check_shasum (file : str , expected_shasum : str ):
294300 with open (file , "rb" ) as f :
295301 digest = hashlib .file_digest (f , "sha256" )
@@ -580,6 +586,16 @@ def make_emscripten_python(context, working_dir):
580586 subprocess .check_call ([exec_script , "--version" ])
581587
582588
589+ @subdir ("host_dir" )
590+ def pythoninfo_emscripten_python (context , working_dir ):
591+ """Display build info for the host/Emscripten Python."""
592+ call (
593+ ["make" , "pythoninfo" ],
594+ env = updated_env ({}, context .emsdk_cache ),
595+ quiet = context .quiet ,
596+ )
597+
598+
583599def run_emscripten_python (context ):
584600 """Run the built emscripten Python."""
585601 host_dir = context .build_paths ["host_dir" ]
@@ -595,8 +611,6 @@ def run_emscripten_python(context):
595611
596612 if context .test :
597613 args = load_config_toml ()["test-args" ] + args
598- elif context .pythoninfo :
599- args = load_config_toml ()["pythoninfo-args" ] + args
600614
601615 os .execv (str (exec_script ), [str (exec_script ), * args ])
602616
@@ -707,6 +721,10 @@ def main():
707721 "make-build-python" , help = "Run `make` for the build Python"
708722 )
709723
724+ pythoninfo_build = subcommands .add_parser (
725+ "pythoninfo-build" , help = "Display build info for the build Python"
726+ )
727+
710728 configure_host = subcommands .add_parser (
711729 "configure-host" ,
712730 help = (
@@ -719,6 +737,10 @@ def main():
719737 "make-host" , help = "Run `make` for the host/emscripten"
720738 )
721739
740+ pythoninfo_host = subcommands .add_parser (
741+ "pythoninfo-host" , help = "Display build info for the host/Emscripten Python"
742+ )
743+
722744 run = subcommands .add_parser (
723745 "run" ,
724746 help = "Run the built emscripten Python" ,
@@ -732,12 +754,6 @@ def main():
732754 "Default arguments loaded from Platforms/emscripten/config.toml"
733755 ),
734756 )
735- run .add_argument (
736- "--pythoninfo" ,
737- action = "store_true" ,
738- default = False ,
739- help = "Run -m test.pythoninfo" ,
740- )
741757 run .add_argument (
742758 "args" ,
743759 nargs = argparse .REMAINDER ,
@@ -770,8 +786,10 @@ def main():
770786 make_mpdec_cmd ,
771787 make_dependencies_cmd ,
772788 make_build ,
789+ pythoninfo_build ,
773790 configure_host ,
774791 make_host ,
792+ pythoninfo_host ,
775793 clean ,
776794 ):
777795 subcommand .add_argument (
@@ -840,8 +858,10 @@ def main():
840858 "make-dependencies" : make_dependencies ,
841859 "configure-build-python" : configure_build_python ,
842860 "make-build-python" : make_build_python ,
861+ "pythoninfo-build" : pythoninfo_build ,
843862 "configure-host" : configure_emscripten_python ,
844863 "make-host" : make_emscripten_python ,
864+ "pythoninfo-host" : pythoninfo_emscripten_python ,
845865 "build" : build_target ,
846866 "run" : run_emscripten_python ,
847867 "clean" : clean_contents ,
0 commit comments