https://github.com/python/cpython/commit/8e605fe7d80ff715ca813e2c1434da34990c6e18
commit: 8e605fe7d80ff715ca813e2c1434da34990c6e18
branch: main
author: Brett Cannon <[email protected]>
committer: brettcannon <[email protected]>
date: 2026-10-28T19:44:31Z
summary:

Add a `release` command to WASI CLI (#160790)

Co-authored-by: Savannah Ostrowski <[email protected]>

files:
M Platforms/WASI/README.md
M Platforms/WASI/__main__.py

diff --git a/Platforms/WASI/README.md b/Platforms/WASI/README.md
index e56645b4db24c1..5fe610615aec33 100644
--- a/Platforms/WASI/README.md
+++ b/Platforms/WASI/README.md
@@ -132,7 +132,7 @@ python3 Platforms/WASI build --quiet --logdir 
cross-build/logs
 ```
 
 
-### Packaging
+### Releasing
 
 The `package` command is used to gather all the files necessary to make a
 release and place them in an archive:
@@ -158,6 +158,16 @@ existing `dist/` directory before gathering files.
 
 There is no command just to archive the gathered files.
 
+To do a release build from `build` to `package`, you can use the `release`
+command:
+
+```shell
+python3 Platforms/WASI release
+```
+
+Any release-specific build flags will be set via `release`. It will also run
+`clean`.
+
 
 ### Paths
 
diff --git a/Platforms/WASI/__main__.py b/Platforms/WASI/__main__.py
index dc1df16f829efe..ee9e0f6de36438 100644
--- a/Platforms/WASI/__main__.py
+++ b/Platforms/WASI/__main__.py
@@ -71,6 +71,9 @@ def main():
     gather = subcommands.add_parser(
         "gather", help="Gather all the files for distribution"
     )
+    release = subcommands.add_parser(
+        "release", help="Build and package for a release"
+    )
     path = subcommands.add_parser(
         "path", help="Print the path to a build or distribution directory"
     )
@@ -94,6 +97,7 @@ def main():
         make_host,
         pythoninfo_host,
         build_host,
+        release,
     ):
         subcommand.add_argument(
             "--quiet",
@@ -133,7 +137,7 @@ def main():
         subcommand.add_argument(
             "args", nargs="*", help="Extra arguments to pass to `configure`"
         )
-    for subcommand in build, configure_host, build_host:
+    for subcommand in build, configure_host, build_host, release:
         subcommand.add_argument(
             "--wasi-sdk",
             type=pathlib.Path,
@@ -160,6 +164,7 @@ def main():
         gather,
         package,
         path,
+        release,
     ):
         subcommand.add_argument(
             "--host-triple",
@@ -211,6 +216,15 @@ def main():
         case "package":
             _package.gather(context)
             _package.archive(context)
+        case "release":
+            context.args = ["--without-static-libpython"]
+            _build.clean_contents(context)
+            _build.configure_build_python(context)
+            _build.make_build_python(context)
+            _build.configure_wasi_python(context)
+            _build.make_wasi_python(context)
+            _package.gather(context)
+            _package.archive(context)
         case "path":
             paths = {
                 "build-python": "build_python_path",

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to