Skip to content

Commit 46a9d12

Browse files
committed
split wheels workflow from tests
1 parent bccea8f commit 46a9d12

File tree

4 files changed

+200
-113
lines changed

4 files changed

+200
-113
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build editdistpy
2+
description: Installs editdistpy
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Environment detail
8+
run: |
9+
pip list --pre
10+
shell: bash -el {0}
11+
12+
- name: Uninstall existing editdistpy
13+
run: |
14+
if pip show editdistpy 1>/dev/null; then
15+
pip uninstall -y editdistpy
16+
fi
17+
shell: bash -el {0}
18+
19+
- name: Build editdistpy
20+
run: |
21+
pip install -v .
22+
shell: bash -el {0}

.github/workflows/tests.yml

Lines changed: 15 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -3,122 +3,24 @@ name: Tests
33
on: [push, pull_request]
44

55
jobs:
6-
build_sdist:
6+
ubuntu:
77
name: Build source distribution
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v4
11-
- uses: actions/setup-python@v5
10+
- name: Checkout editdistpy
11+
uses: actions/checkout@v4
1212
with:
13-
python-version: "3.12"
14-
- name: Build
15-
run: |
16-
python -m pip install --upgrade pip
17-
python -m pip install build
18-
python -m build --sdist
19-
pip install -v dist/editdistpy-*.tar.gz
20-
- name: Install test dependencies
21-
run: |
22-
python -m pip install pytest numpy symspellpy
23-
pytest tests
24-
- uses: actions/upload-artifact@v4
25-
with:
26-
name: artifact-sdist
27-
path: dist/*.tar.gz
28-
build_wheels_linux:
29-
name: Build wheels for ubuntu-latest/${{ matrix.arch }}/${{ matrix.python_tag }}
30-
needs: [build_sdist]
31-
runs-on: ubuntu-latest
32-
strategy:
33-
fail-fast: false
34-
matrix:
35-
arch: [x86_64]
36-
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
37-
steps:
38-
- uses: actions/checkout@v4
39-
# - uses: actions/download-artifact@v4
40-
# with:
41-
# name: artifact-sdist
42-
# path: dist
43-
# - name: Copy wheel
44-
# run: cp dist/editdistpy-*.tar.gz editdistpy.tar.gz
45-
- name: Build wheel
46-
uses: pypa/[email protected]
47-
env:
48-
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
49-
CIBW_BUILD: ${{ matrix.python_tag }}
50-
CIBW_BUILD_VERBOSITY: 3
51-
CIBW_BEFORE_TEST: pip install symspellpy --no-deps
52-
CIBW_TEST_REQUIRES: pytest numpy
53-
CIBW_TEST_COMMAND: python -m pytest --traceconfig -sv {project}/tests
54-
with:
55-
output-dir: wheelhouse
56-
- uses: actions/upload-artifact@v4
57-
with:
58-
name: artifact-${{ github.job }}-${{ strategy.job-index }}
59-
path: ./wheelhouse/*.whl
60-
build_wheels_macos:
61-
name: Build wheels for macos-latest/${{ matrix.arch }}/${{ matrix.python_tag }}
62-
needs: [build_sdist]
63-
runs-on: macos-latest
64-
strategy:
65-
fail-fast: false
66-
matrix:
67-
arch: [x86_64, arm64]
68-
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
69-
steps:
70-
- uses: actions/checkout@v4
71-
# - uses: actions/download-artifact@v4
72-
# with:
73-
# name: artifact-sdist
74-
# path: dist
75-
# - name: Copy wheel
76-
# run: cp dist/editdistpy-*.tar.gz editdistpy.tar.gz
77-
- name: Build wheel
78-
uses: pypa/[email protected]
79-
env:
80-
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
81-
CIBW_BUILD: ${{ matrix.python_tag }}
82-
CIBW_BUILD_VERBOSITY: 3
83-
CIBW_BEFORE_TEST: pip install symspellpy --no-deps
84-
CIBW_TEST_REQUIRES: pytest numpy
85-
CIBW_TEST_COMMAND: python -m pytest --traceconfig -sv {project}/tests
86-
with:
87-
output-dir: wheelhouse
88-
- uses: actions/upload-artifact@v4
89-
with:
90-
name: artifact-${{ github.job }}-${{ strategy.job-index }}
91-
path: ./wheelhouse/*.whl
13+
fetch-depth: 0
9214

93-
build_wheels_windows:
94-
name: Build wheels for windows-latest/${{ matrix.arch }}/${{ matrix.python_tag }}
95-
needs: [build_sdist]
96-
runs-on: windows-latest
97-
strategy:
98-
fail-fast: false
99-
matrix:
100-
arch: [AMD64]
101-
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
102-
steps:
103-
- uses: actions/checkout@v4
104-
# - uses: actions/download-artifact@v4
105-
# with:
106-
# name: artifact-sdist
107-
# path: dist
108-
# - name: Copy wheel
109-
# run: cp dist/editdistpy-*.tar.gz editdistpy.tar.gz
110-
- name: Build wheel
111-
uses: pypa/[email protected]
112-
env:
113-
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
114-
CIBW_BUILD: ${{ matrix.python_tag }}
115-
CIBW_BUILD_VERBOSITY: 3
116-
CIBW_BEFORE_TEST: pip install symspellpy --no-deps
117-
CIBW_TEST_REQUIRES: pytest numpy
118-
CIBW_TEST_COMMAND: python -m pytest --traceconfig -sv {project}/tests
119-
with:
120-
output-dir: wheelhouse
121-
- uses: actions/upload-artifact@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
12217
with:
123-
name: artifact-${{ github.job }}-${{ strategy.job-index }}
124-
path: ./wheelhouse/*.whl
18+
python-version: "3.12"
19+
20+
- name: Build editdistpy
21+
uses: ./.github/actions/build_editdistpy
22+
23+
- name: Test
24+
run: |
25+
python -m pip install -r requirements-dev.txt
26+
pytest

.github/workflows/wheels.yml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
name: Wheel builder
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build_sdist:
7+
name: Build source distribution
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout editdistpy
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
20+
- name: Build sdist
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install build
24+
python -m build --sdist
25+
26+
- name: Upload sdist
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: artifact-sdist
30+
path: ./dist/*
31+
32+
- name: Sanity check sdist files
33+
run: |
34+
ls ./dist
35+
36+
- name: Output sdist name
37+
id: save-path
38+
run: |
39+
echo "sdist_name=$(ls ./dist)" >> "${GITHUB_OUTPUT}"
40+
shell: bash -el {0}
41+
42+
build_wheels_linux:
43+
needs: [build_sdist]
44+
name: Build wheels for ubuntu-latest/${{ matrix.arch }}/${{ matrix.python_tag }}
45+
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
arch: [x86_64]
50+
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
51+
steps:
52+
- name: Checkout editdistpy
53+
uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
57+
# - uses: actions/download-artifact@v4
58+
# with:
59+
# name: artifact-sdist
60+
# path: dist
61+
#
62+
# - name: Copy wheel
63+
# run: cp dist/editdistpy-*.tar.gz editdistpy.tar.gz
64+
65+
- name: Build wheel
66+
uses: pypa/[email protected]
67+
env:
68+
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
69+
CIBW_BUILD: ${{ matrix.python_tag }}
70+
CIBW_BUILD_VERBOSITY: 3
71+
CIBW_BEFORE_TEST: pip install symspellpy --no-deps
72+
CIBW_TEST_REQUIRES: pytest numpy
73+
CIBW_TEST_COMMAND: python -m pytest --traceconfig -sv {project}/tests
74+
with:
75+
output-dir: wheelhouse
76+
77+
- uses: actions/upload-artifact@v4
78+
with:
79+
name: artifact-${{ github.job }}-${{ strategy.job-index }}
80+
path: ./wheelhouse/*.whl
81+
82+
build_wheels_macos:
83+
needs: [build_sdist]
84+
name: Build wheels for macos-latest/${{ matrix.arch }}/${{ matrix.python_tag }}
85+
runs-on: macos-latest
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
arch: [x86_64, arm64]
90+
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
91+
steps:
92+
- name: Checkout editdistpy
93+
uses: actions/checkout@v4
94+
with:
95+
fetch-depth: 0
96+
97+
# - uses: actions/download-artifact@v4
98+
# with:
99+
# name: artifact-sdist
100+
# path: dist
101+
#
102+
# - name: Copy wheel
103+
# run: cp dist/editdistpy-*.tar.gz editdistpy.tar.gz
104+
105+
- name: Build wheel
106+
uses: pypa/[email protected]
107+
env:
108+
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
109+
CIBW_BUILD: ${{ matrix.python_tag }}
110+
CIBW_BUILD_VERBOSITY: 3
111+
CIBW_BEFORE_TEST: pip install symspellpy --no-deps
112+
CIBW_TEST_REQUIRES: pytest numpy
113+
CIBW_TEST_COMMAND: python -m pytest --traceconfig -sv {project}/tests
114+
with:
115+
output-dir: wheelhouse
116+
117+
- uses: actions/upload-artifact@v4
118+
with:
119+
name: artifact-${{ github.job }}-${{ strategy.job-index }}
120+
path: ./wheelhouse/*.whl
121+
122+
build_wheels_windows:
123+
needs: [build_sdist]
124+
name: Build wheels for windows-latest/${{ matrix.arch }}/${{ matrix.python_tag }}
125+
runs-on: windows-latest
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
arch: [AMD64]
130+
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*"]
131+
steps:
132+
- name: Checkout editdistpy
133+
uses: actions/checkout@v4
134+
with:
135+
fetch-depth: 0
136+
137+
# - uses: actions/download-artifact@v4
138+
# with:
139+
# name: artifact-sdist
140+
# path: dist
141+
#
142+
# - name: Copy wheel
143+
# run: cp dist/editdistpy-*.tar.gz editdistpy.tar.gz
144+
145+
- name: Build wheel
146+
uses: pypa/[email protected]
147+
env:
148+
CIBW_ARCHS_WINDOWS: ${{ matrix.arch }}
149+
CIBW_BUILD: ${{ matrix.python_tag }}
150+
CIBW_BUILD_VERBOSITY: 3
151+
CIBW_BEFORE_TEST: pip install symspellpy --no-deps
152+
CIBW_TEST_REQUIRES: pytest numpy
153+
CIBW_TEST_COMMAND: python -m pytest --traceconfig -sv {project}/tests
154+
with:
155+
output-dir: wheelhouse
156+
157+
- uses: actions/upload-artifact@v4
158+
with:
159+
name: artifact-${{ github.job }}-${{ strategy.job-index }}
160+
path: ./wheelhouse/*.whl

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
graft editdistpy
2+
3+
global-exclude *.py[ocd]

0 commit comments

Comments
 (0)