From d45603db711df262e9cf6865cabd573ab726a0f9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 23 Mar 2026 17:34:27 +0100 Subject: [PATCH 1/3] gh-146197: Run -m test.pythoninfo on the Emscripten CI --- .github/workflows/reusable-emscripten.yml | 2 ++ Platforms/emscripten/__main__.py | 10 ++++++++++ Platforms/emscripten/config.toml | 3 +++ 3 files changed, 15 insertions(+) diff --git a/.github/workflows/reusable-emscripten.yml b/.github/workflows/reusable-emscripten.yml index 549ff671a68e9c..fd269df9eada24 100644 --- a/.github/workflows/reusable-emscripten.yml +++ b/.github/workflows/reusable-emscripten.yml @@ -68,5 +68,7 @@ jobs: run: python3 Platforms/emscripten configure-host --host-runner node -- --config-cache - name: "Make host Python" run: python3 Platforms/emscripten make-host + - name: "Display build info" + run: python3 Platforms/emscripten run --pythoninfo - name: "Test" run: python3 Platforms/emscripten run --test diff --git a/Platforms/emscripten/__main__.py b/Platforms/emscripten/__main__.py index 3db998a048e7e2..cd068e32c97395 100644 --- a/Platforms/emscripten/__main__.py +++ b/Platforms/emscripten/__main__.py @@ -591,6 +591,8 @@ def run_emscripten_python(context): if context.test: args = load_config_toml()["test-args"] + args + elif context.pythoninfo: + args = load_config_toml()["pythoninfo-args"] + args os.execv(str(exec_script), [str(exec_script), *args]) @@ -726,6 +728,14 @@ def main(): "Default arguments loaded from Platforms/emscripten/config.toml" ), ) + run.add_argument( + "--pythoninfo", + action="store_true", + default=False, + help=( + "If passed, run -m test.pythoninfo" + ), + ) run.add_argument( "args", nargs=argparse.REMAINDER, diff --git a/Platforms/emscripten/config.toml b/Platforms/emscripten/config.toml index 99a7b73884559d..8cc49596263987 100644 --- a/Platforms/emscripten/config.toml +++ b/Platforms/emscripten/config.toml @@ -11,6 +11,9 @@ test-args = [ "--single-process", "-W", ] +pythoninfo= [ + "-m", "test.pythoninfo", +] [dependencies.libffi] url = "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz" From 3ca1048fc1ffa0060658a9e0ecafecb8a51f1e26 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 23 Mar 2026 17:44:22 +0100 Subject: [PATCH 2/3] Fix typo in config.toml (add "-args" suffix) --- Platforms/emscripten/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platforms/emscripten/config.toml b/Platforms/emscripten/config.toml index 8cc49596263987..ba2dc8f4a482bf 100644 --- a/Platforms/emscripten/config.toml +++ b/Platforms/emscripten/config.toml @@ -11,7 +11,7 @@ test-args = [ "--single-process", "-W", ] -pythoninfo= [ +pythoninfo-args = [ "-m", "test.pythoninfo", ] From b56a4949be5149ddbf64f00845fa33c20c4dfa2f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 23 Mar 2026 18:04:49 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> --- Platforms/emscripten/__main__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Platforms/emscripten/__main__.py b/Platforms/emscripten/__main__.py index cd068e32c97395..1958de7986c46b 100644 --- a/Platforms/emscripten/__main__.py +++ b/Platforms/emscripten/__main__.py @@ -724,7 +724,7 @@ def main(): action="store_true", default=False, help=( - "If passed, will add the default test arguments to the beginning of the command. " + "Add the default test arguments to the beginning of the command. " "Default arguments loaded from Platforms/emscripten/config.toml" ), ) @@ -732,9 +732,7 @@ def main(): "--pythoninfo", action="store_true", default=False, - help=( - "If passed, run -m test.pythoninfo" - ), + help="Run -m test.pythoninfo", ) run.add_argument( "args",