Skip to content

Fix up rustjswasm #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- js
- jupyter
- rust
# - rustjswasm
- rustjswasm
os:
- ubuntu-latest
- macos-latest
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

- uses: actions-ext/node/setup@main
with:
version: 20.x
version: 22.x
js_folder: "."

- uses: actions-ext/rust/setup@main
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ test-rust:
cd ../python-template-rust && make test

test-rustjswasm:
cd ../python-template-rust && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-rust && make develop
cd ../python-template-rust && git add Cargo.lock && git commit -m "lockfile"
cd ../python-template-rust && make lint
cd ../python-template-rust && make checks
cd ../python-template-rust && make test
cd ../python-template-rustjswasm && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit"
cd ../python-template-rustjswasm && make develop
cd ../python-template-rustjswasm && git add Cargo.lock && git commit -m "lockfile"
cd ../python-template-rustjswasm && make lint
cd ../python-template-rustjswasm && make checks
cd ../python-template-rustjswasm && make test


2 changes: 2 additions & 0 deletions cpp/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ js/coverage
js/dist
js/lib
js/node_modules
js/test-results
js/playwright-report
js/*.tgz
{{module}}/extension

Expand Down
4 changes: 2 additions & 2 deletions cpp/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ major: ## bump a major version
########
.PHONY: dist dist-py dist-check publish

dist-py: # build python dists
dist-py: ## build python dists
python -m build -w -s

dist-check: ## run python dist checker with twine
python -m twine check dist/*

dist: clean build dist-js dist-py dist-check ## build all dists

publish: dist # publish python assets
publish: dist ## publish python assets

#########
# CLEAN #
Expand Down
2 changes: 1 addition & 1 deletion js/.github/workflows/build.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: actions-ext/node/setup@main
with:
version: 20.x
version: 22.x

- name: Install dependencies
run: make develop
Expand Down
2 changes: 2 additions & 0 deletions js/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ js/coverage
js/dist
js/lib
js/node_modules
js/test-results
js/playwright-report
js/*.tgz
{{module}}/extension

Expand Down
4 changes: 2 additions & 2 deletions js/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ major: ## bump a major version
########
.PHONY: dist dist-py dist-js dist-check publish

dist-py: # build python dists
dist-py: ## build python dists
python -m build -w -s

dist-js: # build js dists
Expand All @@ -145,7 +145,7 @@ dist-check: ## run python dist checker with twine

dist: clean build dist-js dist-py dist-check ## build all dists

publish: dist # publish python assets
publish: dist ## publish python assets

#########
# CLEAN #
Expand Down
2 changes: 0 additions & 2 deletions js/js/.prettierignore

This file was deleted.

4 changes: 2 additions & 2 deletions js/js/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"build": "node build.mjs",
"clean": "rm -rf dist playwright-report ../{{module}}/extension",
"dev": "npm-run-all -p start watch",
"lint": "prettier --check \"src/**/*\" \"tests/**/*\" \"*.mjs\" \"*.json\"",
"fix": "prettier --write \"src/**/*\" \"tests/**/*\" \"*.mjs\" \"*.json\"",
"lint": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix": "prettier --write \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"preinstall": "npx only-allow pnpm",
"prepack": "npm run build",
"start": "http-server -p 3000 -o examples/",
Expand Down
4 changes: 1 addition & 3 deletions js/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ exclude = [

[tool.hatch.build.targets.wheel]
packages = ["{{module}}"]
exclude = [
"/js"
]
exclude = ["/js"]

[tool.hatch.build.hooks.hatch-js]
path = "js"
Expand Down
2 changes: 1 addition & 1 deletion jupyter/.github/workflows/build.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: actions-ext/node/setup@main
with:
version: 20.x
version: 22.x

- name: Install dependencies
run: make develop
Expand Down
2 changes: 2 additions & 0 deletions jupyter/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ js/coverage
js/dist
js/lib
js/node_modules
js/test-results
js/playwright-report
js/*.tgz
{{module}}/extension

Expand Down
4 changes: 2 additions & 2 deletions jupyter/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ major: ## bump a major version
########
.PHONY: dist dist-py dist-js dist-check publish

dist-py: # build python dists
dist-py: ## build python dists
python -m build -w -s

dist-js: # build js dists
Expand All @@ -145,7 +145,7 @@ dist-check: ## run python dist checker with twine

dist: clean build dist-js dist-py dist-check ## build all dists

publish: dist # publish python assets
publish: dist ## publish python assets

#########
# CLEAN #
Expand Down
2 changes: 2 additions & 0 deletions python/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ js/coverage
js/dist
js/lib
js/node_modules
js/test-results
js/playwright-report
js/*.tgz
{{module}}/extension

Expand Down
2 changes: 1 addition & 1 deletion python/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ dist-check: ## run python dist checker with twine

dist: clean dist-build dist-check ## build all dists

publish: dist # publish python assets
publish: dist ## publish python assets

#########
# CLEAN #
Expand Down
2 changes: 2 additions & 0 deletions rust/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ js/coverage
js/dist
js/lib
js/node_modules
js/test-results
js/playwright-report
js/*.tgz
{{module}}/extension

Expand Down
20 changes: 5 additions & 15 deletions rust/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,19 @@ requirements-rs: ## install prerequisite rust build requirements

requirements: requirements-rs requirements-py ## setup project for development

.PHONY: build-py build-rs build dev
.PHONY: build-py build-rs build
build-py:
python -m build -w -n

build-rs:
make -C rust build

dev: build ## lightweight in-place build for iterative dev
$(_CP_COMMAND)

build: build-rs build-py ## build the project

.PHONY: install
install: ## install python library
uv pip install .

UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
_CP_COMMAND := cp target/debug/lib{{module}}.dylib {{module}}/{{module}}.abi3.so
else
_CP_COMMAND := cp target/debug/lib{{module}}.so {{module}}/{{module}}.abi3.so
endif

#########
# LINTS #
#########
Expand Down Expand Up @@ -146,21 +136,21 @@ major: ## bump a major version
########
.PHONY: dist-py-wheel dist-py-sdist dist-rs dist-check dist publish

dist-py-wheel: # build python wheel
dist-py-wheel: ## build python wheel
python -m cibuildwheel --output-dir dist

dist-py-sdist: # build python sdist
dist-py-sdist: ## build python sdist
python -m build --sdist -o dist

dist-rs: # build rust dists
dist-rs: ## build rust dists
make -C rust dist

dist-check: ## run python dist checker with twine
python -m twine check dist/*

dist: clean build dist-rs dist-py-wheel dist-py-sdist dist-check ## build all dists

publish: dist # publish python assets
publish: dist ## publish python assets

#########
# CLEAN #
Expand Down
11 changes: 5 additions & 6 deletions rust/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,23 @@ ignore = [
]

[tool.cibuildwheel]
before-build = "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y"
before-all = "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y"
build = "cp39-*"
skip = "*musllinux*"
test-command = "pytest -vvv {project}/{{module}}/tests"
test-requires = ["pytest", "pytest-cov", "pytest-sugar", "pytest-xdist"]

[tool.cibuildwheel.linux]
before-build = """
before-all = """
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y
rustup target add aarch64-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu
rustup show
"""
environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always"}
skip = "*i686 musllinux*"
skip = "*i686* *musllinux*"

[tool.cibuildwheel.macos]
before-build = """
before-all = """
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
Expand All @@ -118,7 +117,7 @@ environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always", MACOS_D
archs = "arm64"

[tool.cibuildwheel.windows]
before-build = """
before-all = """
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y
rustup target add x86_64-pc-windows-msvc
rustup target add aarch64-pc-windows-msvc
Expand Down
8 changes: 6 additions & 2 deletions rustjswasm/.github/workflows/build.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["{{python_version_primary}}"]
cibuildwheel: ["cp{{python_version_primary.replace('.', '')}}"]
node-version: [20.x]

steps:
Expand All @@ -44,13 +45,14 @@ jobs:

- uses: actions-ext/node/setup@main
with:
version: 20.x
version: 22.x

- name: Install dependencies
run: make develop

- name: Lint
run: make lint
if: matrix.os == 'ubuntu-latest'

- name: Checks
run: make checks
Expand All @@ -67,7 +69,7 @@ jobs:
with:
name: {% raw %}test-results-${{ matrix.os }}-${{ matrix.python-version }}{% endraw %}
path: '**/junit.xml'
if: {% raw %}${{ always() }}{% endraw %}
if: matrix.os == 'ubuntu-latest'

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
Expand All @@ -92,6 +94,8 @@ jobs:
make dist-py-sdist
make dist-py-wheel
make dist-check
env:
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %}
if: matrix.os == 'ubuntu-latest'

- name: Make dist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions-ext/python/setup@main
- uses: actions-ext/rust/setup@main
- uses: actions-ext/node/setup@main
- run: make develop
- run: uv pip install .
- run: uv pip install yardang
- run: yardang build
Expand Down
5 changes: 5 additions & 0 deletions rustjswasm/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,16 @@ js/coverage
js/dist
js/lib
js/node_modules
js/test-results
js/playwright-report
js/*.tgz
{{module}}/extension

# Jupyter
.ipynb_checkpoints
.autoversion
!{{module}}/extension/{{module}}.json
!{{module}}/extension/install.json
{{module}}/nbextension
{{module}}/labextension

Expand Down
Loading
Loading