Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: extism/python-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.1alpha
Choose a base ref
...
head repository: extism/python-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.0-rc0
Choose a head ref
  • 5 commits
  • 17 files changed
  • 1 contributor

Commits on Oct 11, 2023

  1. feat(docs): initial sphinx docs build (#9)

    The `Makefile` and `make.bat` are autogenerated via `sphinx-quickstart`;
    generally we'll want to use `just docs` instead. I left them in in case
    they're load-bearing for readthedocs (which we'll want to enable when we
    make this repo public.)
    Chris Dickinson authored Oct 11, 2023
    Configuration menu
    Copy the full SHA
    860d275 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. feat(host_fn): infer types from annotations (#11)

    Infer host function Wasm types from type annotations if given. When
    inferred, parameters and return values are automatically marshaled and
    unmarshaled and "current plugin" access is hidden. Whenever a host
    function is declared, add it to a thread-local registry of host
    functions. Default `Plugin` creation will use the global list of
    plugins.
    
    In the weeds note: because this means we have to hang on to functions at
    specific addresses, we always end up using user_data now: in particular
    we store the offset of the target host function in the user_data to
    determine which implementation to call. I added this because the FFI
    call would fail if the target python host function wasn't available at
    module-level; this would turn into a stack overflow (it appeared that
    the runtime tried to re-invoke a host function infinitely if it couldn't
    find it.)
    
    ---
    
    Example of inferred decorator + global host func registry:
    
    ```python
    import typings
    import extism
    @extism.host_fn()
    def incr_json(input: typings.Annotated[dict, extism.Json]) -> str
        return input.get("hello", "world")
    
    with extism.Plugin(some_wasm_file) as plugin:
        plugin.call("incr_json", json.dumps({"hello", "earth"}))
    ```
    Chris Dickinson authored Oct 16, 2023
    Configuration menu
    Copy the full SHA
    5804356 View commit details
    Browse the repository at this point in the history
  2. dep(extism_sys): upgrade to 1.0.0rc0

    Chris Dickinson committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    5ceefe8 View commit details
    Browse the repository at this point in the history
  3. Add README

    Chris Dickinson committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    fd68f69 View commit details
    Browse the repository at this point in the history
  4. v1.0.0-rc0

    Chris Dickinson committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    f494fff View commit details
    Browse the repository at this point in the history
Loading