-
Notifications
You must be signed in to change notification settings - Fork 63
Python tooling docs fail with NotImplmentedError #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
tl;dr - use Hey @sachitv are you still seeing this problem with the latest documentation & tooling ? The examples do work for me (likely thanks to the previous work done fixing the docs) -- though I used Generally, with the files set up like so:
(Files in the above files match exactly what was written in the language guide) I was able to generate bindings (optional!): uv tool componentize-py bindings . This step is optional, but it will serve as a peek behind the curtain, as you can see the generated code. To build a component, you can run uv tool componentize-py componentize example -o component.wasm This will build the example and output it to cargo run --release -- 1 2 /path/to/your/component.wasm [EDIT] I just noticed that your problem was with the running we do need to update the docs to include the
The documentation doesn't go far enough in making it clear HOW to do this. The correct incantation is:
After that, you can generate bindings with:
With code like the following, the example will work: from add import Root
from wasmtime import Config, Engine, Store
def main():
config = Config()
config.cache = True
engine = Engine(config)
store = Store(engine)
component = Root(store)
print("1 + 2 = ", component.add(store, 1, 2))
if __name__ == '__main__':
main() |
I was following the instructions here: https://component-model.bytecodealliance.org/language-support/python.html#running-components-from-python-applications
I have tried using wasmtime from the fork mentioned there (dicej/wasmtime-py) as well as wasmtime 14.0.0 but I encounter failures when running wasmtime.bindgen.
Environment
Ubuntu 22.04 (amd64) also reproduced on Mac OS Sonoma (14.1) (arm64)
Poetry 1.7.0
Python 3.12.0 via pyenv
Command:
python3 -m wasmtime.bindgen add.wasm --out-dir add
Failure:
The text was updated successfully, but these errors were encountered: