Skip to content

Commit 425d476

Browse files
authored
Merge pull request #27 from karthik2804/README/update_build_step
update README
2 parents 7b19681 + ecedc5c commit 425d476

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ This is an experiment to build a Spin Python SDK using CPython, Wizer, and PyO3.
1010
- [Spin](https://github.com/fermyon/spin)
1111
- [pipenv](https://pypi.org/project/pipenv/) for installing Python project dependencies
1212

13+
## Installing the Plugin and Running Examples
14+
15+
Use the following command to install the `py2wasm` plugin and then build the spin app:
16+
17+
```
18+
spin plugins update
19+
spin plugins install py2wasm
20+
cd examples/hello world
21+
spin build
22+
spin up
23+
```
24+
1325
## Building and Running
1426

1527
First, build CPython for wasm32-wasi:
@@ -39,8 +51,14 @@ make
3951
Finally, build and run the example app:
4052

4153
```
42-
cd examples/hello
43-
pipenv install
44-
spin build
54+
cd examples/hello_world
55+
../../target/release/spin-python app -o app.wasm
4556
spin up
4657
```
58+
59+
**Note:* `spin-python` and `py2wasm` are just different names for the same command. `spin-python` is used in the context of running the binary in a standalone context while `py2wasm` is used when the command is run via Spin. In the samples provided in the `examples` directory, the `spin build` command depends on the plugin `py2wasm` being installed. Therefore, to test the locally built `spin-python` binary, replace the build command in the `spin.toml` to invoke it using spin build.
60+
61+
```
62+
[component.build]
63+
command = "../../target/release/spin-python app -o app.wasm"
64+
```

0 commit comments

Comments
 (0)