Skip to content

Commit

Permalink
Fix Cython tests on Python 3.12 (#1759)
Browse files Browse the repository at this point in the history
Our "test from PyPI" workflow was failing with Python 3.12 because it
exercised the Cython tests, which use `cython.inline`, and
`cython.inline` in turn uses `distutils`, which no longer exists in the
Python 3.12 standard library.

As a temporary workaround, this PR adds `setuptools` to the list of
packages installed into the test environment; `setuptools` provides a
shim for `distutils`.

I'd guess that at some point in the reasonably near future the
dependence of Cython on `distutils` will be fixed.

Closely related upstream issue:
cython/cython#5751
  • Loading branch information
mdickinson committed Oct 9, 2023
1 parent b1aee80 commit 3c6b250
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-from-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
allow-prereleases: true
- name: Install test dependencies and Traits from PyPI sdist (no PySide6)
run: |
python -m pip install --no-binary traits Cython numpy Sphinx traits traitsui
python -m pip install --no-binary traits Cython numpy setuptools Sphinx traits traitsui
if: matrix.python-version == '3.12' || matrix.python-architecture == 'x86'
- name: Install test dependencies and Traits from PyPI sdist (PySide6)
run: |
python -m pip install --no-binary traits Cython numpy PySide6 Sphinx traits traitsui
python -m pip install --no-binary traits Cython numpy PySide6 setuptools Sphinx traits traitsui
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
Expand Down Expand Up @@ -100,11 +100,11 @@ jobs:
allow-prereleases: true
- name: Install test dependencies and Traits from PyPI wheel (no PySide6)
run: |
python -m pip install --only-binary traits Cython numpy Sphinx traits traitsui
python -m pip install --only-binary traits Cython numpy setuptools Sphinx traits traitsui
if: matrix.python-version == '3.12' || matrix.python-architecture == 'x86'
- name: Install test dependencies and Traits from PyPI wheel (PySide6)
run: |
python -m pip install --only-binary traits Cython numpy PySide6 Sphinx traits traitsui
python -m pip install --only-binary traits Cython numpy PySide6 setuptools Sphinx traits traitsui
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
Expand Down

0 comments on commit 3c6b250

Please sign in to comment.