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: 2 additions & 1 deletion .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 5 additions & 3 deletions js/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -25,7 +27,7 @@ async function build() {
}
}
}
fs.rmSync("../python_template_cppjswasm/extension", {
fs.rmSync(EXTENSION, {
recursive: true,
force: true,
});
Expand All @@ -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/"),
Expand Down
5 changes: 5 additions & 0 deletions python_template_cppjswasm/extension_cpp.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
class Example:
stuff: str

def __init__(self, value: str) -> None: ...

def add(i: int, j: int) -> int: ...
Loading