componentize-py 0.22.0__tar.gz → 0.23.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {componentize_py-0.22.0 → componentize_py-0.23.0}/Cargo.lock +1 -1
- {componentize_py-0.22.0 → componentize_py-0.23.0}/Cargo.toml +1 -1
- {componentize_py-0.22.0 → componentize_py-0.23.0}/PKG-INFO +1 -1
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/cli/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/cli-p3/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/http/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/http-p3/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/matrix-math/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/sandbox/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/tcp/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/tcp-p3/README.md +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/pyproject.toml +1 -1
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/command.rs +123 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/lib.rs +285 -201
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/python.rs +2 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/summary.rs +32 -26
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/echoes.rs +1 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/tests.rs +5 -1
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test.rs +5 -2
- {componentize_py-0.22.0 → componentize_py-0.23.0}/test-generator/src/lib.rs +1 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/.cargo/config.toml +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/.github/workflows/lint.sh +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/.github/workflows/release.yaml +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/.github/workflows/test.yaml +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/.gitignore +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/.gitmodules +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/CONTRIBUTING.md +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/LICENSE +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/README.md +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/adapters/README.md +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/adapters/ab5a4484/wasi_snapshot_preview1.reactor.wasm +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/build.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/bundled/componentize_py_async_support/__init__.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/bundled/componentize_py_async_support/futures.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/bundled/componentize_py_async_support/streams.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/bundled/componentize_py_runtime.pyi +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/bundled/componentize_py_types.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/bundled/poll_loop.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/cli/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/cli-p3/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/http/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/http-p3/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/matrix-math/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/sandbox/guest.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/sandbox/host.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/sandbox/sandbox.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/tcp/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/examples/tcp-p3/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/pyo3-config.txt +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/bin/componentize-py.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/link.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/prelink.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/stubwasi.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/bar_sdk/__init__.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/bar_sdk/componentize-py.toml +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/bar_sdk/wit/deps/foo_sdk/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/bar_sdk/wit/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/echoes_generated.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/foo_sdk/__init__.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/foo_sdk/componentize-py.toml +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/foo_sdk/wit/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/app.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/resource_aggregates.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/resource_alias1.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/resource_borrow_export.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/resource_borrow_in_record.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/resource_floats_exports.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/resource_import_and_export.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/resource_with_lists.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/python_source/streams_and_futures.py +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/wit/echoes.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/test/wit/tests.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/src/util.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/test-generator/Cargo.toml +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/tests/bindings.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/tests/componentize.rs +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/command-extended.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli/command.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli/environment.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli/exit.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli/imports.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli/run.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli/stdio.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli/terminal.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli-0.3.0-rc-2026-01-06.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli-0.3.0-rc-2026-02-09.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/cli-0.3.0-rc-2026-03-15.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/clocks/monotonic-clock.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/clocks/wall-clock.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/clocks/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/clocks-0.3.0-rc-2026-01-06.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/clocks-0.3.0-rc-2026-02-09.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/clocks-0.3.0-rc-2026-03-15.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/filesystem/preopens.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/filesystem/types.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/filesystem/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/filesystem-0.3.0-rc-2026-01-06.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/filesystem-0.3.0-rc-2026-02-09.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/filesystem-0.3.0-rc-2026-03-15.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/http/handler.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/http/proxy.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/http/types.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/http-0.3.0-rc-2026-01-06.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/http-0.3.0-rc-2026-02-09.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/http-0.3.0-rc-2026-03-15.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/io/error.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/io/poll.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/io/streams.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/io/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/random/insecure-seed.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/random/insecure.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/random/random.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/random/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/random-0.3.0-rc-2026-01-06.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/random-0.3.0-rc-2026-02-09.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/random-0.3.0-rc-2026-03-15.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/instance-network.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/ip-name-lookup.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/network.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/tcp-create-socket.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/tcp.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/udp-create-socket.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/udp.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets/world.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets-0.3.0-rc-2026-01-06.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets-0.3.0-rc-2026-02-09.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/deps/sockets-0.3.0-rc-2026-03-15.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/init.wit +0 -0
- {componentize_py-0.22.0 → componentize_py-0.23.0}/wit/matrix-math.wit +0 -0
|
@@ -10,7 +10,7 @@ run a Python-based component targetting the [wasi-cli] `command` world.
|
|
|
10
10
|
## Prerequisites
|
|
11
11
|
|
|
12
12
|
* `Wasmtime` 38.0.0 or later
|
|
13
|
-
* `componentize-py` 0.
|
|
13
|
+
* `componentize-py` 0.23.0
|
|
14
14
|
|
|
15
15
|
Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If
|
|
16
16
|
you don't have `cargo`, you can download and install from
|
|
@@ -18,7 +18,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0.
|
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
cargo install --version 38.0.0 wasmtime-cli
|
|
21
|
-
pip install componentize-py==0.
|
|
21
|
+
pip install componentize-py==0.23.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Running the demo
|
|
@@ -11,7 +11,7 @@ run a Python-based component targetting version `0.3.0-rc-2026-03-15` of the
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
13
|
* `Wasmtime` 43.0.0
|
|
14
|
-
* `componentize-py` 0.
|
|
14
|
+
* `componentize-py` 0.23.0
|
|
15
15
|
|
|
16
16
|
Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If
|
|
17
17
|
you don't have `cargo`, you can download and install from
|
|
@@ -19,7 +19,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v43.0.0.
|
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
cargo install --version 43.0.0 wasmtime-cli
|
|
22
|
-
pip install componentize-py==0.
|
|
22
|
+
pip install componentize-py==0.23.0
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Running the demo
|
|
@@ -10,7 +10,7 @@ run a Python-based component targetting the [wasi-http] `proxy` world.
|
|
|
10
10
|
## Prerequisites
|
|
11
11
|
|
|
12
12
|
* `Wasmtime` 38.0.0 or later
|
|
13
|
-
* `componentize-py` 0.
|
|
13
|
+
* `componentize-py` 0.23.0
|
|
14
14
|
|
|
15
15
|
Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If
|
|
16
16
|
you don't have `cargo`, you can download and install from
|
|
@@ -18,7 +18,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0.
|
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
cargo install --version 38.0.0 wasmtime-cli
|
|
21
|
-
pip install componentize-py==0.
|
|
21
|
+
pip install componentize-py==0.23.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Running the demo
|
|
@@ -11,7 +11,7 @@ run a Python-based component targetting version `0.3.0-rc-2026-03-15` of the
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
13
|
* `Wasmtime` 43.0.0
|
|
14
|
-
* `componentize-py` 0.
|
|
14
|
+
* `componentize-py` 0.23.0
|
|
15
15
|
|
|
16
16
|
Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If
|
|
17
17
|
you don't have `cargo`, you can download and install from
|
|
@@ -19,7 +19,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v43.0.0.
|
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
cargo install --version 43.0.0 wasmtime-cli
|
|
22
|
-
pip install componentize-py==0.
|
|
22
|
+
pip install componentize-py==0.23.0
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Running the demo
|
|
@@ -11,7 +11,7 @@ within a guest component.
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
13
|
* `wasmtime` 38.0.0 or later
|
|
14
|
-
* `componentize-py` 0.
|
|
14
|
+
* `componentize-py` 0.23.0
|
|
15
15
|
* `NumPy`, built for WASI
|
|
16
16
|
|
|
17
17
|
Note that we use an unofficial build of NumPy since the upstream project does
|
|
@@ -23,7 +23,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0.
|
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
cargo install --version 38.0.0 wasmtime-cli
|
|
26
|
-
pip install componentize-py==0.
|
|
26
|
+
pip install componentize-py==0.23.0
|
|
27
27
|
curl -OL https://github.com/dicej/wasi-wheels/releases/download/v0.0.2/numpy-wasi.tar.gz
|
|
28
28
|
tar xf numpy-wasi.tar.gz
|
|
29
29
|
```
|
|
@@ -12,10 +12,10 @@ versions have a different API for working with components, and this example has
|
|
|
12
12
|
not yet been updated to use it.
|
|
13
13
|
|
|
14
14
|
* `wasmtime-py` 38.0.0
|
|
15
|
-
* `componentize-py` 0.
|
|
15
|
+
* `componentize-py` 0.23.0
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
pip install componentize-py==0.
|
|
18
|
+
pip install componentize-py==0.23.0 wasmtime==38.0.0
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Running the demo
|
|
@@ -11,7 +11,7 @@ making an outbound TCP request using `wasi-sockets`.
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
13
13
|
* `Wasmtime` 38.0.0 or later
|
|
14
|
-
* `componentize-py` 0.
|
|
14
|
+
* `componentize-py` 0.23.0
|
|
15
15
|
|
|
16
16
|
Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If
|
|
17
17
|
you don't have `cargo`, you can download and install from
|
|
@@ -19,7 +19,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.0.
|
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
cargo install --version 38.0.0 wasmtime-cli
|
|
22
|
-
pip install componentize-py==0.
|
|
22
|
+
pip install componentize-py==0.23.0
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Running the demo
|
|
@@ -12,7 +12,7 @@ run a Python-based component targetting version `0.3.0-rc-2026-03-15` of the
|
|
|
12
12
|
## Prerequisites
|
|
13
13
|
|
|
14
14
|
* `Wasmtime` 43.0.0
|
|
15
|
-
* `componentize-py` 0.
|
|
15
|
+
* `componentize-py` 0.23.0
|
|
16
16
|
|
|
17
17
|
Below, we use [Rust](https://rustup.rs/)'s `cargo` to install `Wasmtime`. If
|
|
18
18
|
you don't have `cargo`, you can download and install from
|
|
@@ -20,7 +20,7 @@ https://github.com/bytecodealliance/wasmtime/releases/tag/v43.0.0.
|
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
cargo install --version 43.0.0 wasmtime-cli
|
|
23
|
-
pip install componentize-py==0.
|
|
23
|
+
pip install componentize-py==0.23.0
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Running the demo
|
|
@@ -102,6 +102,14 @@ pub enum Command {
|
|
|
102
102
|
|
|
103
103
|
/// Generate Python bindings for the world and write them to the specified
|
|
104
104
|
/// directory.
|
|
105
|
+
///
|
|
106
|
+
/// Note that bindings generated using this command are only stubs which
|
|
107
|
+
/// unconditionally raise `NotImplementedError`s. They are meant for use by
|
|
108
|
+
/// e.g. IDEs, type checkers, and document generators. The `componentize`
|
|
109
|
+
/// subcommand will generate the real code (i.e. code connected to the
|
|
110
|
+
/// components actual imports and exports) on-the-fly as necessary. The
|
|
111
|
+
/// bindings generated by this command need not and should not be used by an
|
|
112
|
+
/// actual component produced using the `componentize` command.
|
|
105
113
|
Bindings(Bindings),
|
|
106
114
|
}
|
|
107
115
|
|
|
@@ -183,7 +191,7 @@ pub fn run<T: Into<OsString> + Clone, I: IntoIterator<Item = T>>(args: I) -> Res
|
|
|
183
191
|
|
|
184
192
|
fn generate_bindings(common: Common, bindings: Bindings) -> Result<()> {
|
|
185
193
|
BindingsGenerator {
|
|
186
|
-
|
|
194
|
+
wit_paths: &common
|
|
187
195
|
.wit_path
|
|
188
196
|
.iter()
|
|
189
197
|
.map(|v| v.as_path())
|
|
@@ -226,7 +234,7 @@ fn componentize(common: Common, componentize: Componentize) -> Result<()> {
|
|
|
226
234
|
|
|
227
235
|
Runtime::new()?.block_on(
|
|
228
236
|
ComponentGenerator {
|
|
229
|
-
|
|
237
|
+
wit_paths: &common
|
|
230
238
|
.wit_path
|
|
231
239
|
.iter()
|
|
232
240
|
.map(|v| v.as_path())
|
|
@@ -521,4 +529,117 @@ class Bindings(bindings.Bindings):
|
|
|
521
529
|
};
|
|
522
530
|
componentize(common, componentize_opts)
|
|
523
531
|
}
|
|
532
|
+
|
|
533
|
+
#[test]
|
|
534
|
+
fn mix_of_cli_and_dependency_wits_and_worlds() -> Result<()> {
|
|
535
|
+
let dir = tempfile::tempdir()?;
|
|
536
|
+
|
|
537
|
+
let cli_wit_file = dir.path().join("cli.wit");
|
|
538
|
+
fs::write(
|
|
539
|
+
&cli_wit_file,
|
|
540
|
+
br#"
|
|
541
|
+
package test:cli;
|
|
542
|
+
|
|
543
|
+
interface cli-interface {
|
|
544
|
+
foo: func();
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
world cli-world {
|
|
548
|
+
import cli-interface;
|
|
549
|
+
export cli-interface;
|
|
550
|
+
export foo: func();
|
|
551
|
+
}
|
|
552
|
+
"#,
|
|
553
|
+
)?;
|
|
554
|
+
|
|
555
|
+
let app_file = dir.path().join("app.py");
|
|
556
|
+
fs::write(
|
|
557
|
+
&app_file,
|
|
558
|
+
br#"
|
|
559
|
+
import cli_world
|
|
560
|
+
from cli_world import exports
|
|
561
|
+
from cli_world.imports import cli_interface
|
|
562
|
+
from lib.wit.imports import lib_interface
|
|
563
|
+
|
|
564
|
+
class CliWorld(cli_world.CliWorld):
|
|
565
|
+
def foo(self) -> None:
|
|
566
|
+
pass
|
|
567
|
+
|
|
568
|
+
class CliInterface(exports.CliInterface):
|
|
569
|
+
def foo(self) -> None:
|
|
570
|
+
lib_interface.foo()
|
|
571
|
+
cli_interface.foo()
|
|
572
|
+
"#,
|
|
573
|
+
)?;
|
|
574
|
+
|
|
575
|
+
let lib_dir = dir.path().join("lib");
|
|
576
|
+
let lib_wit_dir = lib_dir.join("wit");
|
|
577
|
+
fs::create_dir_all(&lib_wit_dir)?;
|
|
578
|
+
|
|
579
|
+
fs::write(
|
|
580
|
+
lib_dir.join("componentize-py.toml"),
|
|
581
|
+
br#"
|
|
582
|
+
wit_directory = "wit"
|
|
583
|
+
bindings = "wit"
|
|
584
|
+
"#,
|
|
585
|
+
)?;
|
|
586
|
+
|
|
587
|
+
fs::write(
|
|
588
|
+
lib_wit_dir.join("lib.wit"),
|
|
589
|
+
br#"
|
|
590
|
+
package test:lib;
|
|
591
|
+
|
|
592
|
+
interface lib-interface {
|
|
593
|
+
foo: func();
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
world lib-world {
|
|
597
|
+
import lib-interface;
|
|
598
|
+
}
|
|
599
|
+
"#,
|
|
600
|
+
)?;
|
|
601
|
+
|
|
602
|
+
generate_bindings(
|
|
603
|
+
Common {
|
|
604
|
+
wit_path: vec![lib_wit_dir.clone()],
|
|
605
|
+
world: vec!["test:lib/lib-world".into()],
|
|
606
|
+
world_module: Some("lib.wit".into()),
|
|
607
|
+
quiet: false,
|
|
608
|
+
features: Vec::new(),
|
|
609
|
+
all_features: false,
|
|
610
|
+
import_interface_name: Vec::new(),
|
|
611
|
+
export_interface_name: Vec::new(),
|
|
612
|
+
full_names: false,
|
|
613
|
+
},
|
|
614
|
+
Bindings {
|
|
615
|
+
output_dir: lib_wit_dir,
|
|
616
|
+
},
|
|
617
|
+
)?;
|
|
618
|
+
|
|
619
|
+
componentize(
|
|
620
|
+
Common {
|
|
621
|
+
wit_path: vec![cli_wit_file],
|
|
622
|
+
world: vec!["test:cli/cli-world".into(), "test:lib/lib-world".into()],
|
|
623
|
+
world_module: Some("cli_world".into()),
|
|
624
|
+
quiet: false,
|
|
625
|
+
features: Vec::new(),
|
|
626
|
+
all_features: false,
|
|
627
|
+
import_interface_name: Vec::new(),
|
|
628
|
+
export_interface_name: Vec::new(),
|
|
629
|
+
full_names: false,
|
|
630
|
+
},
|
|
631
|
+
Componentize {
|
|
632
|
+
app_name: "app".into(),
|
|
633
|
+
python_path: vec![
|
|
634
|
+
dir.path()
|
|
635
|
+
.to_str()
|
|
636
|
+
.ok_or_else(|| anyhow::anyhow!("non-UTF8 path"))?
|
|
637
|
+
.into(),
|
|
638
|
+
],
|
|
639
|
+
module_worlds: vec![],
|
|
640
|
+
output: dir.path().join("app.wasm"),
|
|
641
|
+
stub_wasi: false,
|
|
642
|
+
},
|
|
643
|
+
)
|
|
644
|
+
}
|
|
524
645
|
}
|