Skip to content

Commit

Permalink
Update CI and workflows for Python 3.12 support (#1757)
Browse files Browse the repository at this point in the history
Python 3.12 is imminent. This is an experimental PR to add Python 3.12
support:

- Add 3.12 to the trove classifiers
- Add 3.12 to CI test matrices
- Allow running tests with PySide6 on Python 3.11, but not on Python
3.12
- Update cibuildwheel to latest version so that Python 3.12 eggs are
built when making a release

Making this as a draft PR for now, since the possible failure modes are
many and varied.
  • Loading branch information
mdickinson committed Sep 11, 2023
1 parent 36a95d5 commit b1aee80
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: python -m pip install twine

- name: Build wheels
uses: pypa/cibuildwheel@v2.9.0
uses: pypa/cibuildwheel@v2.15.0

- name: Check and upload wheels
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-core-traits-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

runs-on: ${{ matrix.os }}

Expand All @@ -21,6 +21,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install local package
run: |
# Uninstall setuptools so that the tests will catch any accidental
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/run-traits-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- workflow_dispatch

env:
# Temporary workaround prior to release of Traits 8.0
# Temporary workaround prior to release of TraitsUI 8.0
# xref: enthought/traits#1742
ETS_QT4_IMPORTS: 1

Expand All @@ -14,13 +14,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Install Linux packages for Qt 5 support
- name: Install Linux packages for Qt support
run: |
sudo apt-get update
sudo apt-get install libegl1
Expand All @@ -37,6 +37,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies and local packages
run: |
python -m pip install .[test]
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/test-from-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Install Linux packages for Qt 5 support
- name: Install Linux packages for Qt support
run: |
sudo apt-get update
sudo apt-get install libegl1
Expand All @@ -45,14 +45,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
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
if: matrix.python-version == '3.11' || matrix.python-architecture == 'x86'
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
if: matrix.python-version != '3.11' && matrix.python-architecture != 'x86'
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
mkdir testdir
Expand All @@ -67,7 +68,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
Expand All @@ -78,7 +79,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Install Linux packages for Qt 5 support
- name: Install Linux packages for Qt support
run: |
sudo apt-get update
sudo apt-get install libegl1
Expand All @@ -96,14 +97,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
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
if: matrix.python-version == '3.11' || matrix.python-architecture == 'x86'
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
if: matrix.python-version != '3.11' && matrix.python-architecture != 'x86'
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
- name: Create clean test directory
run: |
mkdir testdir
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ['setuptools<65.2', 'wheel']
requires = ['setuptools', 'wheel']
build-backend = 'setuptools.build_meta'

[tool.black]
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def get_long_description():
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering
Topic :: Software Development
Expand Down Expand Up @@ -316,9 +317,11 @@ def get_long_description():
"flake8",
"flake8-ets",
"mypy",
"numpy",
# NumPy is not yet available for Python 3.12, but that should be
# fixed soon: https://github.com/numpy/numpy/issues/23808
"numpy; python_version < '3.12'",
"pyface",
"PySide6; python_version >= '3.7' and python_version < '3.11'",
"PySide6; python_version >= '3.7' and python_version < '3.12'",
"setuptools",
"Sphinx>=2.1.0",
"traitsui",
Expand Down

0 comments on commit b1aee80

Please sign in to comment.