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
2 changes: 1 addition & 1 deletion .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions js/build.mjs
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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
Expand All @@ -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();
4 changes: 2 additions & 2 deletions js/tools/css.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Loading