Skip to content

Commit fead162

Browse files
authored
Merge pull request #131 from python-project-templates/tkp/cppjswa
Normalize cpp and rust
2 parents f676a53 + d32a41d commit fead162

File tree

5 files changed

+64
-55
lines changed

5 files changed

+64
-55
lines changed

cpp/.github/workflows/build.yaml.jinja

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -84,33 +84,6 @@ jobs:
8484
run: make checks
8585
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
8686

87-
- name: Install build dependencies
88-
run: pip install cibuildwheel
89-
90-
- name: Build (Linux)
91-
run: make build-cibw
92-
env:
93-
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %}
94-
CIBW_BUILD_VERBOSITY: 3
95-
if: matrix.os == 'ubuntu-latest'
96-
97-
- name: Build (Macos)
98-
run: make build-cibw
99-
env:
100-
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-macos*"{% endraw %}
101-
CIBW_BUILD_VERBOSITY: 3
102-
if: matrix.os == 'macos-latest'
103-
104-
- name: Build (Windows)
105-
run: |
106-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
107-
make build-cibw
108-
shell: cmd
109-
env:
110-
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-win_amd64"{% endraw %}
111-
CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
112-
if: matrix.os == 'windows-latest'
113-
11487
- name: Test
11588
run: make coverage
11689

@@ -132,6 +105,37 @@ jobs:
132105
with:
133106
token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %}
134107

108+
- name: Install build dependencies
109+
run: pip install cibuildwheel
110+
111+
- name: Make dist (Linux)
112+
run: |
113+
make dist-py-sdist
114+
make dist-py-wheel
115+
make dist-check
116+
env:
117+
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %}
118+
CIBW_BUILD_VERBOSITY: 3
119+
if: matrix.os == 'ubuntu-latest'
120+
121+
- name: Make dist (Macos)
122+
run: |
123+
make dist-py-wheel
124+
env:
125+
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-macos*"{% endraw %}
126+
CIBW_BUILD_VERBOSITY: 3
127+
if: matrix.os == 'macos-latest'
128+
129+
- name: Make dist (Windows)
130+
run: |
131+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
132+
make dist-py-wheel
133+
shell: cmd
134+
env:
135+
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-win_amd64"{% endraw %}
136+
CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
137+
if: matrix.os == 'windows-latest'
138+
135139
- uses: actions/upload-artifact@v7
136140
with:
137141
name: {% raw %}dist-${{matrix.os}}-${{matrix.python-version}}{% endraw %}

cpp/Makefile.jinja

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ build-py:
1212
build-cpp:
1313
python -m hatchling build --hooks-only
1414

15-
build-cibw:
16-
python -m cibuildwheel --output-dir dist
17-
1815
build: build-cpp build-py ## build the project
1916

2017
.PHONY: install
@@ -114,15 +111,18 @@ major: ## bump a major version
114111
########
115112
# DIST #
116113
########
117-
.PHONY: dist dist-py dist-check publish
114+
.PHONY: dist-py-wheel dist-py-sdist dist-check dist publish
115+
116+
dist-py-wheel: ## build python wheel
117+
python -m cibuildwheel --output-dir dist
118118

119-
dist-py: ## build python dists
120-
python -m build -w -s
119+
dist-py-sdist: ## build python sdist
120+
python -m build --sdist -o dist
121121

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

125-
dist: clean build dist-js dist-py dist-check ## build all dists
125+
dist: clean build dist-py-wheel dist-py-sdist dist-check ## build all dists
126126

127127
publish: dist ## publish python assets
128128

cppjswasm/.github/workflows/build.yaml.jinja

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,54 +66,59 @@ jobs:
6666
run: make checks
6767
if: matrix.os == 'ubuntu-latest'
6868

69-
- name: Build
70-
run: make build
71-
7269
- name: Test
7370
run: make coverage
7471

7572
- name: Upload test results (Python)
7673
uses: actions/upload-artifact@v7
7774
with:
7875
name: {% raw %}test-results-${{ matrix.os }}-${{ matrix.python-version }}{% endraw %}
79-
path: '**/junit.xml'
80-
if: matrix.os == 'ubuntu-latest'
76+
path: junit.xml
77+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
8178

8279
- name: Publish Unit Test Results
8380
uses: EnricoMi/publish-unit-test-result-action@v2
8481
with:
8582
files: '**/junit.xml'
86-
if: matrix.os == 'ubuntu-latest'
83+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
8784

8885
- name: Upload coverage
8986
uses: codecov/codecov-action@v6
9087
with:
9188
token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %}
9289

93-
- name: Set up QEMU
94-
uses: docker/setup-qemu-action@v4
95-
with:
96-
platforms: all
97-
if: runner.os == 'Linux' && runner.arch == 'X64'
90+
- name: Install build dependencies
91+
run: pip install cibuildwheel
9892

99-
- name: Make dist
93+
- name: Make dist (Linux)
10094
run: |
10195
make dist-py-sdist
10296
make dist-py-wheel
10397
make dist-check
10498
env:
10599
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %}
100+
CIBW_BUILD_VERBOSITY: 3
106101
if: matrix.os == 'ubuntu-latest'
107102

108-
- name: Make dist
103+
- name: Make dist (Macos)
109104
run: |
110105
make dist-py-wheel
111-
make dist-check
112106
env:
113-
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0
114-
if: matrix.os != 'ubuntu-latest'
107+
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-macos*"{% endraw %}
108+
CIBW_BUILD_VERBOSITY: 3
109+
if: matrix.os == 'macos-latest'
110+
111+
- name: Make dist (Windows)
112+
run: |
113+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
114+
make dist-py-wheel
115+
shell: cmd
116+
env:
117+
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-win_amd64"{% endraw %}
118+
CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
119+
if: matrix.os == 'windows-latest'
115120

116121
- uses: actions/upload-artifact@v7
117122
with:
118-
name: {% raw %}dist-${{matrix.os}}{% endraw %}
123+
name: {% raw %}dist-${{matrix.os}}-${{matrix.python-version}}{% endraw %}
119124
path: dist

rust/.github/workflows/build.yaml.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ jobs:
8181
platforms: all
8282
if: runner.os == 'Linux' && runner.arch == 'X64'
8383

84-
- name: Make dist
84+
- name: Make dist (Linux)
8585
run: |
8686
make dist-rs
8787
make dist-py-sdist
8888
make dist-py-wheel
8989
make dist-check
9090
if: matrix.os == 'ubuntu-latest'
9191

92-
- name: Make dist
92+
- name: Make dist (Macos / Windows)
9393
run: |
9494
make dist-py-wheel
9595
make dist-check

rustjswasm/.github/workflows/build.yaml.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
platforms: all
8989
if: runner.os == 'Linux' && runner.arch == 'X64'
9090

91-
- name: Make dist
91+
- name: Make dist (Linux)
9292
run: |
9393
make dist-rs
9494
make dist-py-sdist
@@ -98,7 +98,7 @@ jobs:
9898
CIBW_BUILD: {% raw %}"${{ matrix.cibuildwheel }}-manylinux*"{% endraw %}
9999
if: matrix.os == 'ubuntu-latest'
100100

101-
- name: Make dist
101+
- name: Make dist (Macos / Windows)
102102
run: |
103103
make dist-py-wheel
104104
make dist-check

0 commit comments

Comments
 (0)