diff --git a/.copier-answers.yaml b/.copier-answers.yaml index 9aeccfe..4ae3846 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,6 +1,7 @@ # Changes here will be overwritten by Copier -_commit: 02f55bd +_commit: faa8776 _src_path: https://github.com/python-project-templates/base.git +add_c_abi: false add_docs: true add_extension: cppjswasm add_pyodide: true diff --git a/js/build.mjs b/js/build.mjs index c3ee58f..2a7f793 100644 --- a/js/build.mjs +++ b/js/build.mjs @@ -5,6 +5,8 @@ import { node_modules_external } from "./tools/externals.mjs"; import fs from "fs"; import cpy from "cpy"; +const EXTENSION = "../python_template_cppjswasm/extension"; + const BUNDLES = [ { entryPoints: ["src/ts/index.ts"], @@ -25,7 +27,7 @@ async function build() { } } } - fs.rmSync("../python_template_cppjswasm/extension", { + fs.rmSync(EXTENSION, { recursive: true, force: true, }); @@ -45,8 +47,8 @@ async function build() { await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1)); // Copy servable assets to python extension (exclude esm/) - fs.mkdirSync("../python_template_cppjswasm/extension", { recursive: true }); - await cpy("dist/**/*", "../python_template_cppjswasm/extension", { + fs.mkdirSync(EXTENSION, { recursive: true }); + await cpy("dist/**/*", EXTENSION, { filter: (file) => !file.relativePath.startsWith("esm/") && !file.relativePath.startsWith("dist/esm/"), diff --git a/python_template_cppjswasm/extension_cpp.pyi b/python_template_cppjswasm/extension_cpp.pyi index bfb558d..1ee466e 100644 --- a/python_template_cppjswasm/extension_cpp.pyi +++ b/python_template_cppjswasm/extension_cpp.pyi @@ -1 +1,6 @@ +class Example: + stuff: str + + def __init__(self, value: str) -> None: ... + def add(i: int, j: int) -> int: ...