From f1bec596e037669ea8795e8e1e7a79f8b96a382d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 23 Mar 2026 22:33:43 +0100 Subject: [PATCH] Run pythoninfo on Emscripten Add also PythonInfo step and use it in factories. --- master/custom/factories.py | 85 ++++++++++++++------------------------ master/custom/steps.py | 6 +++ 2 files changed, 37 insertions(+), 54 deletions(-) diff --git a/master/custom/factories.py b/master/custom/factories.py index f3f38818..f2ad98de 100644 --- a/master/custom/factories.py +++ b/master/custom/factories.py @@ -18,6 +18,7 @@ LockInstall, Uninstall, UploadTestResults, + PythonInfo, ) # This (default) timeout is for each individual test file. @@ -138,16 +139,11 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs): self.addStep(Compile(command=compile, env=self.compile_environ, **oot_kwargs)) - self.addStep( - ShellCommand( - name="pythoninfo", - description="pythoninfo", - command=["make", "pythoninfo"], - warnOnFailure=True, - env=self.test_environ, - **oot_kwargs - ) - ) + self.addStep(PythonInfo( + command=["make", "pythoninfo"], + env=self.test_environ, + **oot_kwargs + )) self.addStep(Test( command=test, timeout=step_timeout(self.test_timeout), @@ -237,14 +233,9 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs): self.addStep(Compile(command=compile)) self.addStep(Install(command=install)) self.addStep(LockInstall()) - self.addStep( - ShellCommand( - name="pythoninfo", - description="pythoninfo", - command=[installed_python, "-m", "test.pythoninfo"], - warnOnFailure=True, - ) - ) + self.addStep(PythonInfo( + command=[installed_python, "-m", "test.pythoninfo"], + )) self.addStep(Test( command=test, timeout=step_timeout(self.test_timeout), @@ -618,14 +609,9 @@ def setup(self, parallel, branch, **kwargs): if parallel: test_command.append(parallel) self.addStep(Compile(command=build_command)) - self.addStep( - ShellCommand( - name="pythoninfo", - description="pythoninfo", - command=self.python_command + ["-m", "test.pythoninfo"], - warnOnFailure=True, - ) - ) + self.addStep(PythonInfo( + command=self.python_command + ["-m", "test.pythoninfo"], + )) test_command.extend(("--timeout", str(self.test_timeout))) self.addStep(Test( command=test_command, @@ -852,16 +838,11 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs): ) ) if self.can_execute_python: - self.addStep( - ShellCommand( - name="pythoninfo", - description="pythoninfo", - command=["make", "pythoninfo"], - warnOnFailure=True, - env=self.test_environ, - workdir=oot_host_path, - ) - ) + self.addStep(PythonInfo( + command=["make", "pythoninfo"], + env=self.test_environ, + workdir=oot_host_path, + )) self.addStep(Test( command=test, timeout=step_timeout(self.test_timeout), @@ -978,15 +959,10 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs): ) ) - self.addStep( - ShellCommand( - name="pythoninfo", - description="pythoninfo", - command=["make", "pythoninfo"], - warnOnFailure=True, - workdir=host_path, - ) - ) + self.addStep(PythonInfo( + command=["make", "pythoninfo"], + workdir=host_path, + )) # Copied from UnixBuild. testopts = list(self.testFlags) @@ -1307,15 +1283,10 @@ def setup(self, parallel, branch, **kwargs): self.addStep(Compile(command=compile, env=self.compile_environ)) - self.addStep( - ShellCommand( - name="pythoninfo", - description="pythoninfo", - command=["make", "pythoninfo"], - warnOnFailure=True, - env=self.test_environ, - ) - ) + self.addStep(PythonInfo( + command=["make", "pythoninfo"], + env=self.test_environ, + )) test = [ "valgrind", @@ -1391,6 +1362,12 @@ def setup(self, **kwargs): command=["python3", "Platforms/emscripten", "make-host"], env=compile_environ, ), + PythonInfo( + command=[ + "python3", "Platforms/emscripten", "run", "--pythoninfo", + ], + env=compile_environ, + ), Test( name="Node full test suite", command=[ diff --git a/master/custom/steps.py b/master/custom/steps.py index 1d221db5..f28f7fdd 100644 --- a/master/custom/steps.py +++ b/master/custom/steps.py @@ -128,6 +128,12 @@ def evaluateCommand(self, cmd): return result +class PythonInfo(ShellCommand): + name = "pythoninfo" + description = "Display build information" + warnOnFailure = True + + class Clean(ShellCommand): name = "clean" flunkOnFailure = False