Skip to content

Commit f1bfb62

Browse files
Update from Copier (2026-08-23T05-40-53Z)
Signed-off-by: python-templates-copier-update[bot] <python-templates-copier-update[bot]@users.noreply.github.com>
1 parent b13e781 commit f1bfb62

6 files changed

Lines changed: 79 additions & 20 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: 2f83523
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: true
55
add_extension: cppjswasm

.github/workflows/build.yaml

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,38 @@ permissions:
2525

2626
jobs:
2727
build:
28+
name: build (${{ matrix.name }})
2829
runs-on: ${{ matrix.os }}
2930

3031
strategy:
3132
matrix:
32-
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
33+
include:
34+
- name: ubuntu-latest
35+
dist_path: dist
36+
os: ubuntu-latest
37+
python: "3.11"
38+
target: native
39+
- name: ubuntu-24.04-arm
40+
dist_path: dist
41+
os: ubuntu-24.04-arm
42+
python: "3.11"
43+
target: native
44+
- name: macos-latest
45+
dist_path: dist
46+
os: macos-latest
47+
python: "3.11"
48+
target: native
49+
- name: windows-latest
50+
dist_path: dist
51+
os: windows-latest
52+
python: "3.11"
53+
target: native
54+
- name: pyodide
55+
dist_path: dist/pyodide
56+
os: ubuntu-latest
57+
python: "3.14"
58+
target: pyodide
59+
3360

3461
steps:
3562
- name: Checkout
@@ -40,53 +67,63 @@ jobs:
4067
- name: Setup Python
4168
uses: actions-ext/python/setup@6e1b91a408ea89f49bc8aff8724f83826f7b5446
4269
with:
43-
version: "3.11"
70+
version: ${{ matrix.python }}
4471

4572
- name: Setup Node.js
4673
uses: actions-ext/node/setup@0ea5bdcd24d2488b28e16bf611b446a2f8e1e12f
4774
with:
4875
version: 22.x
76+
if: matrix.target == 'native'
4977

5078
- name: Setup C++
5179
uses: actions-ext/cpp/setup@c2b1e90366b3a1c628a1df0748135f5e345ab26f
5280

5381
- name: Setup Emscripten
5482
uses: mymindstorm/setup-emsdk@4528d102f7230f0e7b276855c01ea1159be0e984 # v16
83+
if: matrix.target == 'native'
5584

5685
- name: Install dependencies
5786
run: make develop
87+
if: matrix.target == 'native'
5888

5989
- name: Lint
6090
run: make lint
61-
if: matrix.os == 'ubuntu-latest'
91+
if: matrix.name == 'ubuntu-latest'
6292

6393
- name: Checks
6494
run: make checks
65-
if: matrix.os == 'ubuntu-latest'
95+
if: matrix.name == 'ubuntu-latest'
6696

6797
- name: Test
6898
run: make coverage
99+
if: matrix.target == 'native'
100+
101+
- name: Build and test Pyodide wheel
102+
run: make test-pyodide
103+
if: matrix.target == 'pyodide'
69104

70105
- name: Upload test results (Python)
71106
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
72107
with:
73-
name: test-results-${{ matrix.os }}
108+
name: test-results-${{ matrix.name }}
74109
path: junit.xml
75-
if: matrix.os == 'ubuntu-latest'
110+
if: matrix.name == 'ubuntu-latest'
76111

77112
- name: Publish test results
78113
uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
79114
with:
80115
files: '**/junit.xml'
81-
if: matrix.os == 'ubuntu-latest'
116+
if: matrix.name == 'ubuntu-latest'
82117

83118
- name: Upload coverage
84119
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
85120
with:
86121
token: ${{ secrets.CODECOV_TOKEN }}
122+
if: matrix.target == 'native'
87123

88124
- name: Install build dependencies
89125
run: pip install cibuildwheel
126+
if: matrix.target == 'native'
90127

91128
- name: Build distributions (Linux x86_64)
92129
run: |
@@ -98,7 +135,7 @@ jobs:
98135
CIBW_BUILD: "cp311-manylinux*"
99136
CIBW_ARCHS_LINUX: native
100137
CIBW_BUILD_VERBOSITY: 3
101-
if: matrix.os == 'ubuntu-latest'
138+
if: matrix.name == 'ubuntu-latest'
102139

103140
- name: Build distributions (Linux ARM64)
104141
run: |
@@ -109,7 +146,7 @@ jobs:
109146
CIBW_BUILD: "cp311-manylinux*"
110147
CIBW_ARCHS_LINUX: native
111148
CIBW_BUILD_VERBOSITY: 3
112-
if: matrix.os == 'ubuntu-24.04-arm'
149+
if: matrix.name == 'ubuntu-24.04-arm'
113150

114151
- name: Build distributions (macOS)
115152
run: |
@@ -118,30 +155,30 @@ jobs:
118155
env:
119156
CIBW_BUILD: "cp311-macos*"
120157
CIBW_BUILD_VERBOSITY: 3
121-
if: matrix.os == 'macos-latest'
158+
if: matrix.name == 'macos-latest'
122159

123160
- name: Build distributions (Windows)
124161
run: |
125162
if (Test-Path dist) { Remove-Item dist -Recurse -Force }
126163
make dist-py-wheel
127164
env:
128165
CIBW_BUILD: "cp311-win_amd64"
129-
if: matrix.os == 'windows-latest'
166+
if: matrix.name == 'windows-latest'
130167

131168
- name: Test wheel
132169
uses: actions-ext/python/test-wheel@6e1b91a408ea89f49bc8aff8724f83826f7b5446
133170
with:
134171
module: python_template_cppjswasm
135-
if: runner.os == 'Linux'
172+
if: matrix.target == 'native' && runner.os == 'Linux'
136173

137174
- name: Test source distribution
138175
uses: actions-ext/python/test-sdist@6e1b91a408ea89f49bc8aff8724f83826f7b5446
139176
with:
140177
module: python_template_cppjswasm
141-
if: matrix.os == 'ubuntu-latest'
178+
if: matrix.name == 'ubuntu-latest'
142179

143180
- name: Upload distributions
144181
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
145182
with:
146-
name: dist-${{ matrix.os }}
147-
path: dist
183+
name: dist-${{ matrix.name }}
184+
path: ${{ matrix.dist_path }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ __pycache__/
1313
*.exp
1414
*.lib
1515

16+
# vcpkg
17+
vcpkg/
18+
vcpkg_installed/
19+
1620
# Rust
1721
target
1822
target-capi
@@ -142,6 +146,7 @@ python_template_cppjswasm/labextension
142146

143147
# Emscripten SDK (locally installed)
144148
emsdk
149+
.pyodide_build/
145150

146151
# Mac
147152
.DS_Store

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ develop: develop-cpp develop-js develop-py ## setup project for development
1717

1818
.PHONY: requirements-py requirements-js requirements-cpp requirements
1919
requirements-py: ## install prerequisite python build requirements
20-
python -m pip install --upgrade pip toml
21-
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'`
22-
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'`
20+
uv pip install -r pyproject.toml --extra develop
2321

2422
requirements-js: ## install prerequisite javascript build requirements
2523
cd js; pnpm install && npx playwright install
@@ -136,8 +134,13 @@ tests-cpp: test-cpp
136134
coverage-cpp: ## run C++ tests and collect test coverage
137135
make -C cpp coverage
138136

139-
.PHONY: test coverage tests
137+
.PHONY: test test-pyodide coverage tests
140138
test: test-py test-js test-cpp ## run all tests
139+
140+
test-pyodide: ## build and test the Python package in Pyodide
141+
rm -rf dist/pyodide
142+
uvx --from cibuildwheel==4.2.0 cibuildwheel --only cp314-pyodide_wasm32 --output-dir dist/pyodide .
143+
141144
coverage: coverage-py coverage-js coverage-cpp ## run all tests and collect test coverage
142145

143146
# alias

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[build-system]
22
requires = [
33
"hatchling",
4+
<<<<<<< before updating
45
"hatch-cpp>=0.3.7",
6+
=======
7+
"hatch-cpp>=0.5.0",
8+
>>>>>>> after updating
59
"hatch-js",
610
"pybind11",
711
]
@@ -41,7 +45,11 @@ develop = [
4145
"check-dist",
4246
"cibuildwheel",
4347
"codespell",
48+
<<<<<<< before updating
4449
"hatch-cpp>=0.3.7",
50+
=======
51+
"hatch-cpp>=0.5.0",
52+
>>>>>>> after updating
4553
"hatch-js",
4654
"hatchling",
4755
"pybind11",
@@ -104,6 +112,11 @@ archs = "arm64"
104112
environment = {SKIP_HATCH_JS="1"}
105113
skip = "*win32 *arm_64"
106114

115+
[tool.cibuildwheel.pyodide]
116+
environment = {SKIP_HATCH_JS="1"}
117+
test-command = "python -m pytest -vvv --pyargs python_template_cppjswasm.tests"
118+
test-extras = []
119+
test-requires = ["pytest"]
107120
[tool.coverage.run]
108121
branch = true
109122
omit = [
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)