Skip to content

Commit c2d5954

Browse files
Try to run cython tests with different versions
Co-authored-by: Spencer Brown <spencerb21@live.com>
1 parent 48845b3 commit c2d5954

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,15 @@ jobs:
203203
strategy:
204204
fail-fast: false
205205
matrix:
206-
python: ['3.9', '3.12']
206+
include:
207+
- python: '3.9'
208+
cython: '2'
209+
- python: '3.9'
210+
cython: '3'
211+
- python: '3.11'
212+
cython: '2'
213+
- python: '3.13'
214+
cython: '3'
207215
steps:
208216
- name: Checkout
209217
uses: actions/checkout@v4
@@ -216,18 +224,16 @@ jobs:
216224
- name: install trio and setuptools
217225
run: python -m pip install --upgrade pip . setuptools
218226

219-
- name: install cython<3
220-
run: python -m pip install "cython<3"
221-
- name: compile pyx file
222-
run: cythonize -i tests/cython/test_cython.pyx
223-
- name: import & run module
224-
run: python -c 'import tests.cython.test_cython'
227+
- name: install cython & compile pyx file
228+
run: |
229+
if [ "${{ matrix.cython }}" == "2" ]; then
230+
python -m pip install "cython<3"
231+
cythonize -i tests/cython/test_cython.pyx
232+
elif [ "${{ matrix.cython }}" == "3" ]; then
233+
python -m pip install "cython>=3"
234+
cythonize --inplace tests/cython/test_cython.pyx
235+
fi
225236
226-
- name: install cython>=3
227-
run: python -m pip install "cython>=3"
228-
- name: compile pyx file
229-
# different cython version should trigger a re-compile, but --force just in case
230-
run: cythonize --inplace --force tests/cython/test_cython.pyx
231237
- name: import & run module
232238
run: python -c 'import tests.cython.test_cython'
233239

0 commit comments

Comments
 (0)