]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-152715: Add pythoninfo-build command to Platforms/Apple (#152716)
authorVictor Stinner <vstinner@python.org>
Wed, 1 Jul 2026 02:59:42 +0000 (04:59 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Jul 2026 02:59:42 +0000 (10:59 +0800)
Add a pythoninfo-build command to Platforms/Apple to display build
info of the build Python. The command runs "make pythoninfo".

The "ci" and "build" commands now also run "pythoninfo-build".

Platforms/Apple/__main__.py

index 9f2d2afb0aa0f67d94483516dca4c04b7884b9ad..b294d2720a80dfe810a0a78acb159842ef5e50e0 100644 (file)
@@ -272,6 +272,15 @@ def make_build_python(context: argparse.Namespace) -> None:
         run(["make", "-j", str(os.cpu_count())])
 
 
+def pythoninfo_build_python(context: argparse.Namespace) -> None:
+    """The implementation of the "pythoninfo-build" command."""
+    with (
+        group("Display build info of the build Python"),
+        cwd(subdir("build")),
+    ):
+        run(["make", "pythoninfo"])
+
+
 def apple_target(host: str) -> str:
     """Return the Apple platform identifier for a given host triple."""
     for _, platform_slices in HOSTS.items():
@@ -754,6 +763,7 @@ def build(context: argparse.Namespace, host: str | None = None) -> None:
         for step in [
             configure_build_python,
             make_build_python,
+            pythoninfo_build_python,
         ]:
             step(context)
 
@@ -909,6 +919,9 @@ def parse_args() -> argparse.Namespace:
     make_build = subcommands.add_parser(
         "make-build", help="Run `make` for the build Python"
     )
+    pythoninfo_build = subcommands.add_parser(
+        "pythoninfo-build", help="Display build info of the build Python"
+    )
     configure_host = subcommands.add_parser(
         "configure-host",
         help="Run `configure` for a specific platform and target",
@@ -967,6 +980,7 @@ def parse_args() -> argparse.Namespace:
         clean,
         configure_build,
         make_build,
+        pythoninfo_build,
         configure_host,
         make_host,
         build,
@@ -1078,6 +1092,7 @@ def main() -> None:
         "clean": clean,
         "configure-build": configure_build_python,
         "make-build": make_build_python,
+        "pythoninfo-build": pythoninfo_build_python,
         "configure-host": configure_host_python,
         "make-host": make_host_python,
         "package": package,