Skip to content

Commit d5cdbc9

Browse files
authored
specify --export-interface-name options to componentize-py (#145)
* specify `--export-interface-name` options to `componentize-py` This renames a couple of exported interfaces when generating bindings to avoid ugly class names like `WasiHttpHandler030Rc20260315` in application code. Specifically, this renames the following exports: - `wasi:http/handler@0.3.0-rc-2026-03-15` => `http-handler` - `spin:redis/inbound-redis@3.0.0` => `redis-handler` Signed-off-by: Joel Dice <joel.dice@akamai.com> * update `componentize-py` to v0.22.1 ...which hasn't been released yet, but will be soon. Signed-off-by: Joel Dice <joel.dice@akamai.com> --------- Signed-off-by: Joel Dice <joel.dice@akamai.com>
1 parent 9bffd96 commit d5cdbc9

59 files changed

Lines changed: 126 additions & 134 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
python -m venv venv
2525
source venv/bin/activate
26-
pip install componentize-py==0.22.0 http-router==4.1.2 build==1.4.2 mypy==1.13
26+
pip install componentize-py==0.22.1 http-router==4.1.2 build==1.4.2 mypy==1.13
2727
python -m build
2828
pip install dist/spin_sdk-4.0.0-py3-none-any.whl
2929
bash run_tests.sh

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
- Python
66
- `pip`
7-
- `componentize-py` 0.22.0
7+
- `componentize-py` 0.22.1
88

99
Once you have `pip` installed, you can install `componentize-py` using:
1010

1111
```bash
12-
pip install componentize-py==0.22.0
12+
pip install componentize-py==0.22.1
1313
```
1414

1515
### Generating the bindings

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ enter a virtual environment and then install the desired packages
2424
```shell
2525
python -m venv .venv
2626
source .venv/bin/activate
27-
pip install componentize-py==0.22.0 spin-sdk==4.0.0 mypy==1.8.0
27+
pip install componentize-py==0.22.1 spin-sdk==4.0.0 mypy==1.8.0
2828
```
2929

3030
### Hello, World

docs/v4/http/index.html

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v4/wit/exports/wasi_http_handler_0_3_0_rc_2026_03_15.html renamed to docs/v4/wit/exports/http_handler.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v4/wit/exports/index.html

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v4/wit/exports/spin_redis_inbound_redis_3_0_0.html renamed to docs/v4/wit/exports/redis_handler.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v4/wit/imports/fermyon_spin_config.html

Lines changed: 1 addition & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/external-lib-example/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def handle_queryparams(uri: ParseResult, request: Request) -> Response:
4040
return Response(200, {"content-type": "text/plain"}, bytes(foo, "utf-8"))
4141

4242

43-
class WasiHttpHandler030Rc20260315(http.Handler):
43+
class HttpHandler(http.Handler):
4444
async def handle_request(self, request: Request) -> Response:
4545
# I need to parse the URI because the Request object in Spin
4646
# is in the form /path/to/thing?param1=val1&p2=v2#anchor
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
spin-sdk == 4.0.0
2-
componentize-py == 0.22.0
2+
componentize-py == 0.22.1
33
http-router == 4.1.2

0 commit comments

Comments
 (0)