Skip to content

Commit

Permalink
TraitsUI on Python 3.11 and PySide 6.4 (#1994)
Browse files Browse the repository at this point in the history
Currently seems to work with Pyface 7.x

This PR does the following:
- removes setup.py and moves to a pyproject.toml system (includes
deprecating `traitsui.__version__`)
- updates for Python 3.11
- updates for PySide 6.4
- updates for Pyface 8.0
- lots of messing around with the CI infrastructure
- in particular adds a full set of tests on all supported platforms,
Python versions and toolkit backends
  - adds some bleeding-edge tests
- some drive-by fixes (eg. copy-paste issues with some Wx tests using Qt
APIs)

Currently skipping tests failures on Wx due to failures: see #1998

**Checklist**
- [ ] Add a news fragment if this PR is news-worthy for end users. (see
docs/releases/README.rst)
  • Loading branch information
corranwebster committed Mar 24, 2023
1 parent c08f891 commit 2e224d6
Show file tree
Hide file tree
Showing 43 changed files with 524 additions and 753 deletions.
File renamed without changes.
30 changes: 0 additions & 30 deletions .github/actions/apt-get-qt-deps/action.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Install Qt dependencies on Ubuntu
# Install Qt dependencies

This action calls `apt-get` to install packages required for running Qt on Ubuntu.

Expand All @@ -19,11 +19,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolkit: ['pyqt5']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Qt dependencies for Linux
uses: ./.github/actions/apt-get-qt-deps
if: startsWith(matrix.os, 'ubuntu')
- uses: actions/checkout@v3
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
```
29 changes: 29 additions & 0 deletions .github/actions/install-qt-support/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: install-qt-support
description: 'Install supporting OS packages for Qt-using code'
runs:
using: composite
steps:
- name: Install Linux packages for Qt
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev
sudo apt-get install qtchooser
sudo apt-get install qt5-qmake
sudo apt-get install qtbase5-dev-tools
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
sudo apt-get install pulseaudio
sudo apt-get install libpulse-mainloop-glib0
# Needed to work around https://bugreports.qt.io/browse/PYSIDE-1547
sudo apt-get install libopengl0
# Needed for Qt6 video playback
sudo apt-get install libgstreamer-gl1.0-0
shell: bash
46 changes: 46 additions & 0 deletions .github/workflows/basic-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run test suite for Qt and wxPython

on: [pull_request, workflow_dispatch]

env:
PYTHONUNBUFFERED: 1

jobs:
tests-qt:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.11']
qt-api: ['pyqt5', 'pyside2', 'pyside6']
exclude:
- python-version: '3.11'
qt-api: 'pyside2'
fail-fast: false

env:
ETS_TOOLKIT: qt

runs-on: ${{ matrix.os }}
timeout-minutes: 20 # should be plenty, it's usually < 5

steps:
- name: Check out the target commit
uses: actions/checkout@v3
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and local packages
run: |
python -m pip install ".[${{ matrix.qt-api }},editors,examples,test]"
- name: Create clean test directory
run: |
mkdir testdir
- name: Run the test suite (Linux)
run: cd testdir && xvfb-run -a python -X faulthandler -m unittest discover -v traitsui
if: matrix.os == 'ubuntu-latest'
- name: Run the test suite (Windows/macOS)
run: cd testdir && python -X faulthandler -m unittest discover -v traitsui
if: matrix.os != 'ubuntu-latest'
79 changes: 79 additions & 0 deletions .github/workflows/bleeding-edge-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Run test suite for Qt on bleeding-edge dependencies weekly

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: '0 0 * * 4'

env:
PYTHONUNBUFFERED: 1

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11']
qt-api: ['pyside6']
fail-fast: false

env:
ETS_TOOLKIT: qt

runs-on: ${{ matrix.os }}
timeout-minutes: 20 # should be plenty, it's usually < 5

steps:
- name: Check out the target commit
uses: actions/checkout@v3
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and local packages
run: |
python -m pip install ".[${{ matrix.qt-api }},editors,examples,test]"
- name: Install source dependencies
run: |
python -m pip install --force-reinstall git+http://github.com/enthought/pyface.git#egg=pyface
python -m pip install --force-reinstall git+http://github.com/enthought/traits.git#egg=traits
- name: Create clean test directory
run: |
mkdir testdir
- name: Run the test suite (Linux)
run: cd testdir && xvfb-run -a python -X faulthandler -m unittest discover -v traitsui
if: matrix.os == 'ubuntu-latest'
- name: Run the test suite (Windows/macOS)
run: cd testdir && python -X faulthandler -m unittest discover -v traitsui
if: matrix.os != 'ubuntu-latest'

notify-on-failure:
needs: test
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack channel on failure
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: ${{ secrets.ETS_SLACK_CHANNEL_ID }}
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }}

notify-on-success:
needs: test
if: success()
runs-on: ubuntu-latest
steps:
- name: Notify Slack channel on success
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: ${{ secrets.ETS_BOTS_SLACK_CHANNEL_ID }}
status: SUCCESS
color: good
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }}
74 changes: 0 additions & 74 deletions .github/workflows/bleeding-edge.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/full-qt-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Run test suite for Qt across all supported versions and OS weekly

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: '0 0 * * 4'

env:
PYTHONUNBUFFERED: 1

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
qt-api: ['pyqt5', 'pyside2', 'pyside6']
exclude:
- python-version: '3.11'
qt-api: 'pyside2'
fail-fast: false

env:
ETS_TOOLKIT: qt

runs-on: ${{ matrix.os }}
timeout-minutes: 20 # should be plenty, it's usually < 5

steps:
- name: Check out the target commit
uses: actions/checkout@v3
- name: Install Qt dependencies
uses: ./.github/actions/install-qt-support
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and local packages
run: |
python -m pip install ".[${{ matrix.qt-api }},editors,examples,test]"
- name: Create clean test directory
run: |
mkdir testdir
- name: Run the test suite (Linux)
run: cd testdir && xvfb-run -a python -X faulthandler -m unittest discover -v traitsui
if: matrix.os == 'ubuntu-latest'
- name: Run the test suite (Windows/macOS)
run: cd testdir && python -X faulthandler -m unittest discover -v traitsui
if: matrix.os != 'ubuntu-latest'

notify-on-failure:
needs: test
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack channel on failure
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: ${{ secrets.ETS_SLACK_CHANNEL_ID }}
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }}

notify-on-success:
needs: test
if: success()
runs-on: ubuntu-latest
steps:
- name: Notify Slack channel on success
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel_id: ${{ secrets.ETS_BOTS_SLACK_CHANNEL_ID }}
status: SUCCESS
color: good
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTION_SECRET }}

0 comments on commit 2e224d6

Please sign in to comment.