Skip to content

Commit 8d5d5e7

Browse files
Update from Copier (2026-08-16T19-38-24Z) (#67)
Signed-off-by: python-templates-copier-update[bot] <python-templates-copier-update[bot]@users.noreply.github.com> Co-authored-by: python-templates-copier-update[bot] <python-templates-copier-update[bot]@users.noreply.github.com>
1 parent ca46db1 commit 8d5d5e7

5 files changed

Lines changed: 44 additions & 15 deletions

File tree

.copier-answers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: cb37079
2+
_commit: d814faa
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: true
55
add_extension: cppjswasm

.github/workflows/build.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
strategy:
3131
matrix:
32-
os: [ubuntu-latest, macos-latest, windows-latest]
32+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
3333

3434
steps:
3535
- name: Checkout
@@ -88,17 +88,29 @@ jobs:
8888
- name: Install build dependencies
8989
run: pip install cibuildwheel
9090

91-
- name: Build distributions (Linux)
91+
- name: Build distributions (Linux x86_64)
9292
run: |
9393
rm -rf dist
9494
make dist-py-sdist
9595
make dist-py-wheel
9696
make dist-check
9797
env:
9898
CIBW_BUILD: "cp311-manylinux*"
99+
CIBW_ARCHS_LINUX: native
99100
CIBW_BUILD_VERBOSITY: 3
100101
if: matrix.os == 'ubuntu-latest'
101102

103+
- name: Build distributions (Linux ARM64)
104+
run: |
105+
rm -rf dist
106+
make dist-py-wheel
107+
make dist-check
108+
env:
109+
CIBW_BUILD: "cp311-manylinux*"
110+
CIBW_ARCHS_LINUX: native
111+
CIBW_BUILD_VERBOSITY: 3
112+
if: matrix.os == 'ubuntu-24.04-arm'
113+
102114
- name: Build distributions (macOS)
103115
run: |
104116
rm -rf dist
@@ -120,7 +132,7 @@ jobs:
120132
uses: actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446
121133
with:
122134
module: python_template_cppjswasm
123-
if: matrix.os == 'ubuntu-latest'
135+
if: runner.os == 'Linux'
124136

125137
- name: Test source distribution
126138
uses: actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446

js/build.mjs

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,39 @@ const BUNDLES = [
1818
];
1919

2020
async function build() {
21+
if (fs.existsSync("dist")) {
22+
for (const entry of fs.readdirSync("dist")) {
23+
if (entry !== "pkg") {
24+
fs.rmSync(`dist/${entry}`, { recursive: true, force: true });
25+
}
26+
}
27+
}
28+
fs.rmSync("../python_template_cppjswasm/extension", {
29+
recursive: true,
30+
force: true,
31+
});
32+
2133
// Bundle css
2234
await bundle_css();
2335

2436
// Copy HTML
25-
cpy("src/html/*", "dist/");
37+
await cpy("src/html/*", "dist/");
2638

2739
// Copy images
28-
fs.mkdirSync("dist/img", { recursive: true });
29-
cpy("src/img/*", "dist/img");
40+
if (fs.existsSync("src/img")) {
41+
fs.mkdirSync("dist/img", { recursive: true });
42+
await cpy("src/img/*", "dist/img");
43+
}
3044

3145
await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));
3246

3347
// Copy servable assets to python extension (exclude esm/)
3448
fs.mkdirSync("../python_template_cppjswasm/extension", { recursive: true });
35-
cpy("dist/**/*", "../python_template_cppjswasm/extension", {
36-
filter: (file) => !file.relativePath.startsWith("esm"),
49+
await cpy("dist/**/*", "../python_template_cppjswasm/extension", {
50+
filter: (file) =>
51+
!file.relativePath.startsWith("esm/") &&
52+
!file.relativePath.startsWith("dist/esm/"),
3753
});
3854
}
3955

40-
build();
56+
await build();

js/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@
1818
"./package.json": "./package.json"
1919
},
2020
"files": [
21-
"dist/**/*",
22-
"index.d.ts"
21+
"dist/**/*"
2322
],
2423
"types": "./dist/esm/index.d.ts",
2524
"publishConfig": {
2625
"access": "public"
2726
},
2827
"scripts": {
28+
"build:clean": "node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true}); fs.rmSync('../python_template_cppjswasm/extension',{recursive:true,force:true})\"",
2929
"build:cpp": "node -e \"require('fs').mkdirSync('dist/pkg',{recursive:true})\" && em++ -O2 -std=c++17 -s WASM=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s SINGLE_FILE=1 -s ALLOW_MEMORY_GROWTH=1 -s ENVIRONMENT=web,worker --bind -I ../cpp ../cpp/python-template-cppjswasm/example.cpp src/cpp/bindings.cpp -o dist/pkg/python_template_cppjswasm.js",
3030
"build:debug": "node build.mjs --debug",
3131
"build:prod": "node build.mjs",
32-
"build": "npm-run-all build:cpp build:prod",
32+
"build:types": "tsc",
33+
"build": "npm-run-all build:clean build:cpp build:prod build:types",
3334
"clean": "rm -rf dist lib playwright-report ../python_template_cppjswasm/extension",
3435
"dev": "npm-run-all -p start watch",
3536
"lint:js": "oxlint . && oxfmt --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",

js/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"noFallthroughCasesInSwitch": true,
1515
"outDir": "./dist/esm",
1616
"resolveJsonModule": true,
17-
"rootDir": ".",
17+
"rootDir": "./src/ts",
1818
"skipLibCheck": true,
1919
"strict": true,
2020
"target": "ES2020",
2121
"useDefineForClassFields": true
2222
},
23-
"include": ["./src/ts/*.ts", "./tests/*.ts"]
23+
"include": ["./src/ts/*.ts"]
2424
}

0 commit comments

Comments
 (0)