Skip to content

Commit

Permalink
Update CI for compatibility with Ubuntu 22.04 (#1727)
Browse files Browse the repository at this point in the history
This PR gets CI back to a working state on the latest ubuntu:

- Drop Python 3.6, which isn't supported by the `setup-python` action on
Ubuntu 22.04
- Always test with PySide6 instead of using a mixture of PySide2 and
PySide6
- Don't try to install PySide6 on Python 3.11 (not supported yet) or
32-bit Windows (not supported at all)
- Rework the apt-get list to reflect what's needed for using Qt 6 on
Ubuntu.
- Replace use of the third-party GabrielBB/xvfb-action with xvfb-run.
  • Loading branch information
mdickinson committed Dec 9, 2022
1 parent 5557598 commit 71672a8
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 31 deletions.
2 changes: 1 addition & 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.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

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

Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/run-traits-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

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

Expand All @@ -18,14 +18,14 @@ jobs:
- name: Install Linux packages for Qt 5 support
run: |
sudo apt-get update
sudo apt-get install qt5-default
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
sudo apt-get install libxcb-shape0
if: matrix.os == 'ubuntu-latest'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -37,8 +37,9 @@ jobs:
- name: Create clean test directory
run: |
mkdir testdir
- name: Test Traits package
uses: GabrielBB/xvfb-action@v1
with:
working-directory: testdir
run: python -m unittest discover -v traits
- name: Test Traits package (Linux)
run: cd testdir && xvfb-run -a python -m unittest discover -v traits
if: matrix.os == 'ubuntu-latest'
- name: Test Traits package (Windows/macOS)
run: cd testdir && python -m unittest discover -v traits
if: matrix.os != 'ubuntu-latest'
52 changes: 32 additions & 20 deletions .github/workflows/test-from-pypi.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, macos-latest]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
Expand All @@ -25,37 +25,43 @@ jobs:
- name: Install Linux packages for Qt 5 support
run: |
sudo apt-get update
sudo apt-get install qt5-default
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
sudo apt-get install libxcb-shape0
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install Traits and test dependencies from PyPI sdist
- name: Install test dependencies and Traits from PyPI sdist (no PySide6)
run: |
python -m pip install --no-binary traits traits[test]
python -m pip install --no-binary traits Cython numpy Sphinx traits traitsui
if: matrix.python-version == '3.11' || 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'
- name: Create clean test directory
run: |
mkdir testdir
- name: Test Traits package
uses: GabrielBB/xvfb-action@v1
with:
working-directory: testdir
run: python -m unittest discover -v traits
- name: Test Traits package (Linux)
run: cd testdir && xvfb-run -a python -m unittest discover -v traits
if: matrix.os == 'ubuntu-latest'
- name: Test Traits package (Windows/macOS)
run: cd testdir && python -m unittest discover -v traits
if: matrix.os != 'ubuntu-latest'

test-pypi-wheel:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-architecture: [x86, x64]
exclude:
- os: macos-latest
Expand All @@ -69,31 +75,37 @@ jobs:
- name: Install Linux packages for Qt 5 support
run: |
sudo apt-get update
sudo apt-get install qt5-default
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
sudo apt-get install libxcb-shape0
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Install Traits and test dependencies from PyPI wheel
- name: Install test dependencies and Traits from PyPI wheel (no PySide6)
run: |
python -m pip install --only-binary traits traits[test]
python -m pip install --only-binary traits Cython numpy Sphinx traits traitsui
if: matrix.python-version == '3.11' || 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'
- name: Create clean test directory
run: |
mkdir testdir
- name: Test Traits package
uses: GabrielBB/xvfb-action@v1
with:
working-directory: testdir
run: python -m unittest discover -v traits
- name: Test Traits package (Linux)
run: cd testdir && xvfb-run -a python -m unittest discover -v traits
if: matrix.os == 'ubuntu-latest'
- name: Test Traits package (Windows/macOS)
run: cd testdir && python -m unittest discover -v traits
if: matrix.os != 'ubuntu-latest'

notify-on-failure:
needs: [test-pypi-sdist, test-pypi-wheel]
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ def get_long_description():
"mypy",
"numpy",
"pyface",
"PySide2; python_version < '3.8'",
"PySide6; python_version >= '3.8' and python_version < '3.11'",
"PySide6; python_version >= '3.7' and python_version < '3.11'",
"setuptools",
"Sphinx>=2.1.0",
"traitsui",
Expand Down

0 comments on commit 71672a8

Please sign in to comment.