From 3c6b25025ac6b54fb837823e39ea9b51dac42e1c Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Mon, 9 Oct 2023 16:42:44 +0100 Subject: [PATCH] Fix Cython tests on Python 3.12 (#1759) 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: https://github.com/cython/cython/issues/5751 --- .github/workflows/test-from-pypi.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index 5850587f9..b5c200c4c 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -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: | @@ -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: |