From afe8d7a8c1505cf0f2801787ab95fb8bc695defa Mon Sep 17 00:00:00 2001 From: "python-templates-copier-update[bot]" Date: Sun, 16 Aug 2026 19:38:28 +0000 Subject: [PATCH] Update from Copier (2026-08-16T19-38-24Z) Signed-off-by: python-templates-copier-update[bot] --- .copier-answers.yaml | 2 +- .github/workflows/build.yaml | 18 +++++++++++++++--- js/build.mjs | 28 ++++++++++++++++++++++------ js/package.json | 7 ++++--- js/tsconfig.json | 4 ++-- 5 files changed, 44 insertions(+), 15 deletions(-) diff --git a/.copier-answers.yaml b/.copier-answers.yaml index ce15b60..e36c4ae 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: cb37079 +_commit: d814faa _src_path: https://github.com/python-project-templates/base.git add_docs: true add_extension: cppjswasm diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4a06a5d..966372b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,7 +29,7 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] steps: - name: Checkout @@ -88,7 +88,7 @@ jobs: - name: Install build dependencies run: pip install cibuildwheel - - name: Build distributions (Linux) + - name: Build distributions (Linux x86_64) run: | rm -rf dist make dist-py-sdist @@ -96,9 +96,21 @@ jobs: make dist-check env: CIBW_BUILD: "cp311-manylinux*" + CIBW_ARCHS_LINUX: native CIBW_BUILD_VERBOSITY: 3 if: matrix.os == 'ubuntu-latest' + - name: Build distributions (Linux ARM64) + run: | + rm -rf dist + make dist-py-wheel + make dist-check + env: + CIBW_BUILD: "cp311-manylinux*" + CIBW_ARCHS_LINUX: native + CIBW_BUILD_VERBOSITY: 3 + if: matrix.os == 'ubuntu-24.04-arm' + - name: Build distributions (macOS) run: | rm -rf dist @@ -120,7 +132,7 @@ jobs: uses: actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446 with: module: python_template_cppjswasm - if: matrix.os == 'ubuntu-latest' + if: runner.os == 'Linux' - name: Test source distribution uses: actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446 diff --git a/js/build.mjs b/js/build.mjs index 5e438e2..c3ee58f 100644 --- a/js/build.mjs +++ b/js/build.mjs @@ -18,23 +18,39 @@ const BUNDLES = [ ]; async function build() { + if (fs.existsSync("dist")) { + for (const entry of fs.readdirSync("dist")) { + if (entry !== "pkg") { + fs.rmSync(`dist/${entry}`, { recursive: true, force: true }); + } + } + } + fs.rmSync("../python_template_cppjswasm/extension", { + recursive: true, + force: true, + }); + // Bundle css await bundle_css(); // Copy HTML - cpy("src/html/*", "dist/"); + await cpy("src/html/*", "dist/"); // Copy images - fs.mkdirSync("dist/img", { recursive: true }); - cpy("src/img/*", "dist/img"); + if (fs.existsSync("src/img")) { + fs.mkdirSync("dist/img", { recursive: true }); + await cpy("src/img/*", "dist/img"); + } 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 }); - cpy("dist/**/*", "../python_template_cppjswasm/extension", { - filter: (file) => !file.relativePath.startsWith("esm"), + await cpy("dist/**/*", "../python_template_cppjswasm/extension", { + filter: (file) => + !file.relativePath.startsWith("esm/") && + !file.relativePath.startsWith("dist/esm/"), }); } -build(); +await build(); diff --git a/js/package.json b/js/package.json index ab5dac2..9398763 100644 --- a/js/package.json +++ b/js/package.json @@ -18,18 +18,19 @@ "./package.json": "./package.json" }, "files": [ - "dist/**/*", - "index.d.ts" + "dist/**/*" ], "types": "./dist/esm/index.d.ts", "publishConfig": { "access": "public" }, "scripts": { + "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})\"", "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", "build:debug": "node build.mjs --debug", "build:prod": "node build.mjs", - "build": "npm-run-all build:cpp build:prod", + "build:types": "tsc", + "build": "npm-run-all build:clean build:cpp build:prod build:types", "clean": "rm -rf dist lib playwright-report ../python_template_cppjswasm/extension", "dev": "npm-run-all -p start watch", "lint:js": "oxlint . && oxfmt --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"", diff --git a/js/tsconfig.json b/js/tsconfig.json index b25bdae..b507e71 100644 --- a/js/tsconfig.json +++ b/js/tsconfig.json @@ -14,11 +14,11 @@ "noFallthroughCasesInSwitch": true, "outDir": "./dist/esm", "resolveJsonModule": true, - "rootDir": ".", + "rootDir": "./src/ts", "skipLibCheck": true, "strict": true, "target": "ES2020", "useDefineForClassFields": true }, - "include": ["./src/ts/*.ts", "./tests/*.ts"] + "include": ["./src/ts/*.ts"] }