diff --git a/.copier-answers.yaml b/.copier-answers.yaml index e576a6f..42e64e0 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 05ef55a +_commit: 41c2f2c _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 1baefb3..f9af5da 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -110,18 +110,14 @@ jobs: CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0 if: matrix.os != 'ubuntu-latest' - - name: Test wheel install - run: | - python -m venv /tmp/test-wheel - /tmp/test-wheel/bin/pip install dist/*.whl - /tmp/test-wheel/bin/python -c "import python_template_rust" + - uses: actions-ext/python/test-wheel@main + with: + module: python_template_rust if: matrix.os == 'ubuntu-latest' - - name: Test sdist install - run: | - python -m venv /tmp/test-sdist - /tmp/test-sdist/bin/pip install dist/*.tar.gz - /tmp/test-sdist/bin/python -c "import python_template_rust" + - uses: actions-ext/python/test-sdist@main + with: + module: python_template_rust if: matrix.os == 'ubuntu-latest' - uses: actions/upload-artifact@v7 diff --git a/js/build.mjs b/js/build.mjs index 59f7de8..ab8dcd1 100644 --- a/js/build.mjs +++ b/js/build.mjs @@ -1,9 +1,7 @@ import { bundle } from "./tools/bundle.mjs"; import { bundle_css } from "./tools/css.mjs"; import { node_modules_external } from "./tools/externals.mjs"; -import { getarg } from "./tools/getarg.mjs"; -import { transform } from "lightningcss"; import fs from "fs"; import cpy from "cpy"; @@ -24,8 +22,6 @@ async function build() { await bundle_css(); // Copy HTML - fs.mkdirSync("dist/html", { recursive: true }); - cpy("src/html/*", "dist/html"); cpy("src/html/*", "dist/"); // Copy images @@ -34,9 +30,11 @@ async function build() { await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1)); - // Copy from dist to python + // Copy servable assets to python extension (exclude esm/) fs.mkdirSync("../python_template_rust/extension", { recursive: true }); - cpy("dist/**/*", "../python_template_rust/extension"); + cpy("dist/**/*", "../python_template_rust/extension", { + filter: (file) => !file.relativePath.startsWith("esm"), + }); } build(); diff --git a/js/tools/css.mjs b/js/tools/css.mjs index 4ac3594..67aa219 100644 --- a/js/tools/css.mjs +++ b/js/tools/css.mjs @@ -35,8 +35,8 @@ const bundle_one = async (file, resolver) => { resolver: resolver || DEFAULT_RESOLVER, }); const outName = path.basename(file); - fs.mkdirSync("./dist", { recursive: true }); - fs.writeFileSync(path.join("./dist", outName), code); + fs.mkdirSync("./dist/css", { recursive: true }); + fs.writeFileSync(path.join("./dist/css", outName), code); }; export const bundle_css = async (root = "src/css/index.css", resolver = null) => {