Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: add 3.11 test #861

Closed
wants to merge 18 commits into from
71 changes: 71 additions & 0 deletions .github/workflows/test-with-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test with PyPI

on: [pull_request, workflow_dispatch]

env:
PYTHONUNBUFFERED: 1

jobs:

# Test against PyPI packages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale for splitting this into two separate jobs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean why separate into ubuntu and others? I think the installation command is different (sudo apt-get install), also we might want to test with different python versions on different platforms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what I meant. There are trade-offs here; on one hand, having two separate jobs that do the same thing is a bit of a violation of DRY. On the other hand, it may make sense if there are sufficient differences. I leave it to you.

For the apt-get instructions, it's easy to make that step conditional so that it only runs on Ubuntu systems.

test-with-pypi-ubuntu:
strategy:
matrix:
os: ['ubuntu-latest']
toolkit: ['pyside6']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mdickinson any preference on which versions to test? Do really want all or should we use 3.8 and 3.11 only?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd keep all of them here; this is only testing on Ubuntu with a single toolkit, so we don't have a combinatorial explosion of jobs in the matrix.

We definitely want the extremes (3.7 and 3.11), along with the versions that we care about for EDM (so 3.8). At that point, we could drop 3.9 and 3.10, but I think we should have at least one workflow that exercises the test suite on 3.9 and 3.10, and this one doesn't look like a bad target for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping 3.7 from the workflow would be reasonable if we're also dropping 3.7 support for Chaco in general. If that's what we want to do then that seems fine to me - 3.7 EOL is June this year.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpinte Ah, sorry; I did miss that there was a second job below that also goes through all combinations. As a compromise, I'd suggest testing on all 5 versions on Ubuntu, but limiting ourselves to 3.8 and 3.11 on Windows and macOS.

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Qt dependencies for Linux
run: |
sudo apt-get update
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libglu1-mesa-dev
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the release of PySide 6.5, this will need this as well:

          sudo apt-get install libxcb-cursor0

# Needed to work around https://bugreports.qt.io/browse/PYSIDE-1547
sudo apt-get install libopengl0
if: matrix.toolkit != 'null'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: python -m pip install wheel click coverage pyparsing
- name: Install package under test
run: python -m pip install .
- name: Run tests (Ubuntu)
run: |
mkdir testdir
cd testdir
xvfb-run -a python -X faulthandler -m unittest discover -v chaco

test-with-pypi-others:
strategy:
matrix:
os: ['macos-latest', 'windows-latest']
toolkit: ['pyside6']
python-version: ['3.8', '3.11']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: python -m pip install wheel click coverage pyparsing
- name: Install package under test
run: python -m pip install .
- name: Run tests (not Ubuntu)
run: |
mkdir testdir
cd testdir
python -X faulthandler -m unittest discover -v chaco