anyio support

Offen
#145 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
32/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
python, wasm
Bereich
devtools

Rechercherichtung

Beginne damit, den Fehler in der app.py des http-Beispiels mit dem gezeigten componentize-Befehl zu reproduzieren, und untersuche anschließend, wie componentize-py Python-Module aus der Standardbibliothek wie ssl paketiert. Als erledigt gilt die Aufgabe, wenn das Beispiel während der Komponentisierung anyio importieren kann, ohne ModuleNotFoundError für _ssl auszulösen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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/[email protected] 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 <module>
    sys.exit(script())
             ~~~~~~^^
AssertionError: Traceback (most recent call last):
  File "/0/app.py", line 8, in <module>
    import anyio
  File "/1/anyio/__init__.py", line 26, in <module>
    from ._core._sockets import connect_tcp as connect_tcp
  File "/1/anyio/_core/_sockets.py", line 6, in <module>
    import ssl
  File "/python/ssl.py", line 100, in <module>
    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 🤔

Vorherrschende Sprache
Rust
Sterne
284
Forks
56
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus bytecodealliance/componentize-py

Alle Issues in bytecodealliance/componentize-py

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.