Skip to content

Commit 7f1d543

Browse files
authored
Merge pull request #1256 from tpmccallum/update-python-documentation
Use Spin SDK 3.1.0 and Componentize-Py 0.13.3
2 parents 9835c14 + 16d2c49 commit 7f1d543

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

content/spin/v2/python-components.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The Python SDK is built using [`componentize-py`](https://github.com/bytecodeall
4141
<!-- @selectiveCpy -->
4242

4343
```bash
44-
$ pip3 install componentize-py==0.12.0
44+
$ pip3 install componentize-py==0.13.3
4545
```
4646

4747
> **Please note:** The `hello-world` sample below installs `componentize-py` automatically via the `pip3 install -r requirements.txt` command - so feel free to skip this step if you are following the `hello-world` sample with us.
@@ -127,7 +127,15 @@ The `requirements.txt`, by default, contains the references to the `spin-sdk` an
127127
<!-- @selectiveCpy -->
128128

129129
```bash
130-
$ pip3 install -r requirements.txt
130+
$ pip3 install -r requirements.txt
131+
Collecting spin-sdk==3.1.0 (from -r requirements.txt (line 1))
132+
Using cached spin_sdk-3.1.0-py3-none-any.whl.metadata (16 kB)
133+
Collecting componentize-py==0.13.3 (from -r requirements.txt (line 2))
134+
Using cached componentize_py-0.13.3-cp37-abi3-macosx_10_12_x86_64.whl.metadata (3.4 kB)
135+
Using cached spin_sdk-3.1.0-py3-none-any.whl (94 kB)
136+
Using cached componentize_py-0.13.3-cp37-abi3-macosx_10_12_x86_64.whl (38.8 MB)
137+
Installing collected packages: spin-sdk, componentize-py
138+
Successfully installed componentize-py-0.13.3 spin-sdk-3.1.0
131139
```
132140

133141
## Structure of a Python Component
@@ -174,15 +182,14 @@ Building a Spin HTTP component using the Python SDK means defining a top-level c
174182
<!-- @nocpy -->
175183

176184
```python
177-
from spin_sdk import http
178-
from spin_sdk.http import Request, Response
185+
from spin_sdk.http import IncomingHandler, Request, Response
179186

180-
class IncomingHandler(http.IncomingHandler):
187+
class IncomingHandler(IncomingHandler):
181188
def handle_request(self, request: Request) -> Response:
182189
return Response(
183190
200,
184191
{"content-type": "text/plain"},
185-
bytes("Hello from the Python SDK!", "utf-8")
192+
bytes("Hello from Python!", "utf-8")
186193
)
187194
```
188195

content/wasm-languages/python.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ url = "https://github.com/fermyon/developer/blob/main/content/wasm-languages/pyt
1010
---
1111

1212
Python is one of the most popular programming languages in the world, and its WebAssembly implementation seems to be coming along quickly.
13-
While it is not yet ready for use, we anticipate it will be functional in the first half of 2022.
14-
15-
The most momentum is in the CPython community, which is approaching both Emscripten-based and WASI-based implementations.
1613

1714
## Available Implementations
1815

0 commit comments

Comments
 (0)