From 93a33ea14ebec1d1526e0506603ebdbf06c5e6ed Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Wed, 18 Feb 2026 11:56:46 +0100 Subject: [PATCH 1/4] test `cli-p3` example Signed-off-by: Roman Volosatovs --- tests/bindings.rs | 21 +++++++++++++++++++++ tests/componentize.rs | 17 +++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/tests/bindings.rs b/tests/bindings.rs index 2b583d8..51e92db 100644 --- a/tests/bindings.rs +++ b/tests/bindings.rs @@ -29,6 +29,27 @@ fn lint_cli_bindings() -> anyhow::Result<()> { Ok(()) } +#[test] +fn lint_cli_p3_bindings() -> anyhow::Result<()> { + let dir = tempfile::tempdir()?; + fs_extra::copy_items( + &["./examples/cli-p3", "./wit"], + dir.path(), + &CopyOptions::new(), + )?; + let path = dir.path().join("cli-p3"); + + generate_bindings(&path, "wasi:cli/command@0.3.0-rc-2026-01-06")?; + + assert!(predicate::path::is_dir().eval(&path.join("wit_world"))); + + _ = dir.keep(); + + mypy_check(&path, ["--strict", "-m", "app"]); + + Ok(()) +} + #[test] fn lint_http_bindings() -> anyhow::Result<()> { let dir = tempfile::tempdir()?; diff --git a/tests/componentize.rs b/tests/componentize.rs index e1fa63c..383b405 100644 --- a/tests/componentize.rs +++ b/tests/componentize.rs @@ -14,13 +14,22 @@ use tar::Archive; #[test] fn cli_example() -> anyhow::Result<()> { + test_cli_example("cli", "wasi:cli/command@0.2.0") +} + +#[test] +fn cli_p3_example() -> anyhow::Result<()> { + test_cli_example("cli-p3", "wasi:cli/command@0.3.0-rc-2026-01-06") +} + +fn test_cli_example(name: &str, world: &str) -> anyhow::Result<()> { let dir = tempfile::tempdir()?; fs_extra::copy_items( - &["./examples/cli", "./wit"], + &[format!("./examples/{name}").as_str(), "./wit"], dir.path(), &CopyOptions::new(), )?; - let path = dir.path().join("cli"); + let path = dir.path().join(name); cargo::cargo_bin_cmd!("componentize-py") .current_dir(&path) @@ -28,7 +37,7 @@ fn cli_example() -> anyhow::Result<()> { "-d", "../wit", "-w", - "wasi:cli/command@0.2.0", + world, "componentize", "app", "-o", @@ -40,7 +49,7 @@ fn cli_example() -> anyhow::Result<()> { Command::new("wasmtime") .current_dir(&path) - .args(["run", "cli.wasm"]) + .args(["run", "-Sp3", "-Wcomponent-model-async", "cli.wasm"]) .assert() .success() .stdout("Hello, world!\n"); From 23b6c6b13d88f6dd9fc5ac1162f8456361182d25 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Wed, 18 Feb 2026 11:58:57 +0100 Subject: [PATCH 2/4] add `cli-p3` Wasm to gitignore Signed-off-by: Roman Volosatovs --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d59c72e..5acc1bb 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ examples/http/proxy examples/http/poll_loop.py examples/tcp/tcp.wasm examples/tcp/command +examples/cli-p3/cli.wasm examples/cli/cli.wasm examples/cli/command examples/sandbox/sandbox From 115b3a51c0fd663e2fef6105b280f28d50483a60 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Wed, 18 Feb 2026 11:59:55 +0100 Subject: [PATCH 3/4] update `Cargo.lock` version Signed-off-by: Roman Volosatovs --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 8bfb5fe..fe89d03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -477,7 +477,7 @@ dependencies = [ [[package]] name = "componentize-py" -version = "0.20.0" +version = "0.21.0" dependencies = [ "anyhow", "assert_cmd", From 0ef43b379b9982c341f15936e46bf1b983035956 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Wed, 18 Feb 2026 12:07:04 +0100 Subject: [PATCH 4/4] cli-p3: add `-> None` Signed-off-by: Roman Volosatovs --- examples/cli-p3/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cli-p3/app.py b/examples/cli-p3/app.py index fd4184e..caf22c7 100644 --- a/examples/cli-p3/app.py +++ b/examples/cli-p3/app.py @@ -1,5 +1,5 @@ from wit_world import exports class Run(exports.Run): - async def run(self): + async def run(self) -> None: print("Hello, world!")