Skip to content

Commit 0d9ba83

Browse files
vstinnermiss-islington
authored andcommitted
gh-152715: Add pythoninfo-build command to Platforms/Apple (GH-152716)
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". (cherry picked from commit 746c535) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 67d4cbf commit 0d9ba83

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Apple/__main__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,15 @@ def make_build_python(context: argparse.Namespace) -> None:
272272
run(["make", "-j", str(os.cpu_count())])
273273

274274

275+
def pythoninfo_build_python(context: argparse.Namespace) -> None:
276+
"""The implementation of the "pythoninfo-build" command."""
277+
with (
278+
group("Display build info of the build Python"),
279+
cwd(subdir("build")),
280+
):
281+
run(["make", "pythoninfo"])
282+
283+
275284
def apple_target(host: str) -> str:
276285
"""Return the Apple platform identifier for a given host triple."""
277286
for _, platform_slices in HOSTS.items():
@@ -751,6 +760,7 @@ def build(context: argparse.Namespace, host: str | None = None) -> None:
751760
for step in [
752761
configure_build_python,
753762
make_build_python,
763+
pythoninfo_build_python,
754764
]:
755765
step(context)
756766

@@ -905,6 +915,9 @@ def parse_args() -> argparse.Namespace:
905915
make_build = subcommands.add_parser(
906916
"make-build", help="Run `make` for the build Python"
907917
)
918+
pythoninfo_build = subcommands.add_parser(
919+
"pythoninfo-build", help="Display build info of the build Python"
920+
)
908921
configure_host = subcommands.add_parser(
909922
"configure-host",
910923
help="Run `configure` for a specific platform and target",
@@ -963,6 +976,7 @@ def parse_args() -> argparse.Namespace:
963976
clean,
964977
configure_build,
965978
make_build,
979+
pythoninfo_build,
966980
configure_host,
967981
make_host,
968982
build,
@@ -1074,6 +1088,7 @@ def signal_handler(*args):
10741088
"clean": clean,
10751089
"configure-build": configure_build_python,
10761090
"make-build": make_build_python,
1091+
"pythoninfo-build": pythoninfo_build_python,
10771092
"configure-host": configure_host_python,
10781093
"make-host": make_host_python,
10791094
"package": package,

0 commit comments

Comments
 (0)