Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions template/plugin/__init__.py.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import extism # pyright: ignore
import plugin

<% if (Object.values(schema.schemas).length > 0){ %>
from pdk_types import <%- Object.values(schema.schemas).map(schema => schema.name).join(", ") %> # noqa: F401
<% } %>

# Imports

Expand Down
3 changes: 3 additions & 0 deletions template/plugin/pdk_imports.py.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# THIS FILE WAS GENERATED BY `xtp-python-bindgen`. DO NOT EDIT.

import extism # noqa: F401 # pyright: ignore

<% if (Object.values(schema.schemas).length > 0) { %>
from pdk_types import <%- Object.values(schema.schemas).map(schema => schema.name).join(", ") %> # noqa: F401
<% } %>

<% schema.imports.forEach(imp => { %>
<% if (hasComment(imp)) -%>
Expand Down
4 changes: 4 additions & 0 deletions template/plugin/plugin.py.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import extism # noqa: F401 # pyright: ignore
<% if (Object.values(schema.schemas).length > 0) { %>
from pdk_types import <%- Object.values(schema.schemas).map(schema => schema.name).join(", ") %> # noqa: F401
<% } %>
<% if (schema.imports.length > 0) { %>
from pdk_imports import <%- schema.imports.map(schema => camelToSnakeCase(schema.name)).join(", ") %> # noqa: F401
<% } %>
from typing import List, Optional # noqa: F401

<% schema.exports.forEach(ex => { -%>
Expand Down