bytecodealliance / bytecodealliance/componentize-py
anyio support
- Dominant language
- Rust
- Stars
- 277
- Forks
- 51
- Avg merge
- 12h 10m
- Merged PRs (30d)
- 10
Description
Hi 👋 I'm attempting to componentize a Python app which has `anyio` as a transitive dependency, but it seems that `anyio` imports `ssl` and the `ssl` module isn't present. As a simple repro, if I try to change the `import asyncio` to `import anyio` in the `http` example I see this:
```
❯ uv venv && uv pip install anyio
Using CPython 3.13.0
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
Resolved 3 packages in 1ms
Installed 3 packages in 6ms
+ anyio==4.8.0
+ idna==3.10
+ sniffio==1.3.1
❮ uvx componentize-py -d ../../wit -w wasi:http/proxy@0.2.0 componentize app -o http.wasm -p . -p .venv/lib/python3.13/site-packages
Traceback (most recent call last):
File "/home/ben/.cache/uv/archive-v0/7RckABgkkjmDH-UjGQyxC/bin/componentize-py", line 12, in
sys.exit(script())
~~~~~~^^
AssertionError: Traceback (most recent call last):
File "/0/app.py", line 8, in
import anyio
File "/1/anyio/__init__.py", line 26, in
from ._core._sockets import connect_tcp as connect_tcp
File "/1/anyio/_core/_sockets.py", line 6, in
import ssl
File "/python/ssl.py", line 100, in
import _ssl # if we can't import it, let the error propagate
^^^^^^^^^^^
ModuleNotFoundError: No module named '_ssl'
Caused by:
ModuleNotFoundError: No module named '_ssl'
```
I feel like I'm probably doing something wrong since I couldn't find anything on the issue board about this and it feels like it would have come up already 🤔
Contributor guide
Assessment
This issue has not been assessed yet.