Skip to content

Commit 7d6f69e

Browse files
Update from Copier (2026-08-16T22-46-18Z)
Signed-off-by: python-templates-copier-update[bot] <python-templates-copier-update[bot]@users.noreply.github.com>
1 parent 77e7229 commit 7d6f69e

7 files changed

Lines changed: 47 additions & 6 deletions

File tree

.copier-answers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: d814faa
2+
_commit: 053fbed
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: true
55
add_extension: rust

.github/workflows/build.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,31 @@ jobs:
135135
with:
136136
name: dist-${{ matrix.os }}
137137
path: dist
138+
139+
140+
pyodide:
141+
runs-on: ubuntu-latest
142+
143+
steps:
144+
- name: Checkout
145+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
146+
with:
147+
persist-credentials: false
148+
149+
- name: Setup Python
150+
uses: actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446
151+
with:
152+
version: "3.14"
153+
154+
- name: Setup Rust
155+
uses: actions-ext/rust/setup@2db8e3e4c56beb7320c7d730bd2c2d6a6447bf6b
156+
157+
- name: Build and test Pyodide wheel
158+
run: make test-pyodide
159+
160+
- name: Upload Pyodide distribution
161+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
162+
with:
163+
name: dist-pyodide
164+
path: dist/pyodide
165+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ python_template_rust/labextension
142142

143143
# Emscripten SDK (locally installed)
144144
emsdk
145+
.pyodide_build/
146+
145147

146148
# Mac
147149
.DS_Store

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,13 @@ tests-rs: test-rs
110110
coverage-rs: ## run rust tests and collect test coverage
111111
make -C rust coverage
112112

113-
.PHONY: test coverage tests
113+
.PHONY: test test-pyodide coverage tests
114114
test: test-py test-rs ## run all tests
115+
116+
test-pyodide: ## build and test the Python package in Pyodide
117+
rustup target add wasm32-unknown-emscripten
118+
uvx --from cibuildwheel==4.2.0 cibuildwheel --only cp314-pyodide_wasm32 --output-dir dist/pyodide .
119+
115120
coverage: coverage-py coverage-rs ## run all tests and collect test coverage
116121

117122
# alias

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
22
requires = [
33
"hatchling",
4-
"hatch-rs>=0.1.4",
4+
"hatch-rs>=0.3.0",
55
]
66
build-backend = "hatchling.build"
77

@@ -39,7 +39,7 @@ develop = [
3939
"check-dist",
4040
"cibuildwheel",
4141
"codespell",
42-
"hatch-rs",
42+
"hatch-rs>=0.3.0",
4343
"hatchling",
4444
"mdformat",
4545
"mdformat-tables>=1",
@@ -111,6 +111,11 @@ archs = "arm64"
111111
environment = {PATH="$UserProfile\\.cargo\bin;$PATH", CARGO_TERM_COLOR="always"}
112112
skip = "*win32 *arm_64"
113113

114+
[tool.cibuildwheel.pyodide]
115+
test-command = "python -m pytest -vvv --pyargs python_template_rust.tests"
116+
test-extras = []
117+
test-requires = ["pytest"]
118+
xbuild-tools = ["cargo", "rustc", "rustup"]
114119
[tool.coverage.run]
115120
branch = true
116121
omit = [
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from python_template_rust import *
1+
from python_template_rust.python_template_rust import Example
22

33

44
def test_all():
5-
assert True
5+
assert str(Example("test")) == "test"

0 commit comments

Comments
 (0)