From a5ab11fe4f28010cd15c684882fe3181763a163f Mon Sep 17 00:00:00 2001 From: "python-templates-copier-update[bot]" Date: Sun, 16 Aug 2026 19:38:14 +0000 Subject: [PATCH] Update from Copier (2026-08-16T19-38-09Z) Signed-off-by: python-templates-copier-update[bot] --- .copier-answers.yaml | 2 +- .github/workflows/build.yaml | 28 +++++++++++++++++----------- js/build.mjs | 18 +++++++++++++----- js/package.json | 7 ++++--- js/tsconfig.json | 4 ++-- 5 files changed, 37 insertions(+), 22 deletions(-) diff --git a/.copier-answers.yaml b/.copier-answers.yaml index 0fce866..d979c09 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: rustjswasm diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 56f8fb2..3e460d2 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 @@ -85,20 +85,14 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} - - name: Set up QEMU - uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0 - with: - platforms: all - if: runner.os == 'Linux' && runner.arch == 'X64' - - name: Free disk space run: | sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/share/swift df -h / shell: bash - if: matrix.os == 'ubuntu-latest' + if: runner.os == 'Linux' - - name: Build distributions (Linux) + - name: Build distributions (Linux x86_64) run: | rm -rf dist make dist-rs @@ -106,8 +100,20 @@ jobs: make dist-py-wheel make dist-check shell: bash + env: + CIBW_ARCHS_LINUX: native if: matrix.os == 'ubuntu-latest' + - name: Build distributions (Linux ARM64) + run: | + rm -rf dist + make dist-py-wheel + make dist-check + shell: bash + env: + CIBW_ARCHS_LINUX: native + if: matrix.os == 'ubuntu-24.04-arm' + - name: Build distributions (macOS/Windows) run: | rm -rf dist @@ -116,13 +122,13 @@ jobs: shell: bash env: CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0 - if: matrix.os != 'ubuntu-latest' + if: runner.os != 'Linux' - name: Test wheel uses: actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446 with: module: python_template_rust - 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 946d2b7..01092e0 100644 --- a/js/build.mjs +++ b/js/build.mjs @@ -18,6 +18,18 @@ 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_rust/extension", { + recursive: true, + force: true, + }); + // Bundle css await bundle_css(); @@ -33,10 +45,6 @@ async function build() { await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1)); // Copy servable assets to python extension (exclude esm/) - fs.rmSync("../python_template_rust/extension", { - recursive: true, - force: true, - }); fs.mkdirSync("../python_template_rust/extension", { recursive: true }); await cpy("dist/**/*", "../python_template_rust/extension", { filter: (file) => @@ -45,4 +53,4 @@ async function build() { }); } -build(); +await build(); diff --git a/js/package.json b/js/package.json index f231401..9806a46 100644 --- a/js/package.json +++ b/js/package.json @@ -18,8 +18,7 @@ "./package.json": "./package.json" }, "files": [ - "dist/**/*", - "index.d.ts" + "dist/**/*" ], "types": "./dist/esm/index.d.ts", "publishConfig": { @@ -27,11 +26,13 @@ }, "scripts": { "setup": "cargo install -f wasm-bindgen-cli --version 0.2.126 --locked", + "build:clean": "node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true}); fs.rmSync('../python_template_rust/extension',{recursive:true,force:true})\"", "build:debug": "node build.mjs --debug", "build:rust": "cargo build --release --all-features --target wasm32-unknown-unknown --target-dir ../target", "build:wasm-bindgen": "wasm-bindgen ../target/wasm32-unknown-unknown/release/python_template_rust.wasm --out-dir ./dist/pkg --target web", "build:prod": "node build.mjs", - "build": "npm-run-all build:rust build:wasm-bindgen build:prod", + "build:types": "tsc", + "build": "npm-run-all build:clean build:rust build:wasm-bindgen build:prod build:types", "clean": "rm -rf dist lib playwright-report ../python_template_rust/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"] }