From d2a597b7a7b89cf86c266b8c242a0a4a1f73c685 Mon Sep 17 00:00:00 2001 From: Gavin Hayes Date: Fri, 24 Jan 2025 13:59:49 -0500 Subject: [PATCH] build: fetch interface file for easier development, run uv sync on build so packages just need to be added to pyproject.toml --- template/prepare.sh | 4 ++++ template/xtp.toml.ejs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/template/prepare.sh b/template/prepare.sh index 8411ac7..8f3988c 100644 --- a/template/prepare.sh +++ b/template/prepare.sh @@ -40,3 +40,7 @@ if ! command_exists extism-py; then sleep 2 exit 1 fi + +# Download extism interface file for IDE intellisense +# Ideally we'd have extism-py generate or output this to keep it in-sync +curl -O https://raw.githubusercontent.com/extism/python-pdk/refs/heads/main/extism.pyi diff --git a/template/xtp.toml.ejs b/template/xtp.toml.ejs index 5b6ed23..1da38a8 100644 --- a/template/xtp.toml.ejs +++ b/template/xtp.toml.ejs @@ -8,7 +8,7 @@ name = "<%= project.name %>" [scripts] # xtp plugin build runs this script to generate the wasm file -build = "PYTHONPATH=./plugin:./.venv/lib/python3.13/site-packages extism-py -o plugin.wasm plugin/__init__.py" +build = "uv sync && PYTHONPATH=./plugin:./.venv/lib/python3.13/site-packages extism-py -o plugin.wasm plugin/__init__.py" # xtp plugin init runs this script to format the code format = "uv run ruff format plugin/*.py"