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

Fix architectures in PyPI workflow #1795

Merged
merged 8 commits into from
May 9, 2024
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 32 additions & 61 deletions .github/workflows/test-from-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,112 +6,83 @@ on:
# Run at 03:27 UTC on the 8th and 22nd of every month
- cron: '27 3 8,22 * *'

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

jobs:
test-pypi-sdist:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-architecture: [x86, x64]
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
python-architecture: [x86, x64, arm64]
Copy link

@flongford flongford May 8, 2024

Choose a reason for hiding this comment

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

Potentially this multi-dimensional matrix might work / look a bit cleaner:

Suggested change
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
python-architecture: [x86, x64, arm64]
system:
- os: ubuntu-latest
architecture: x86
- os: windows-latest
architecture: x86
- os: windows-latest
architecture: x64
- os: macos-13
architecture: x86

Then use system.os and system.architecture variables accordingly.

I don't trust GH syntaxt to unpack arrays beyond the first nested set, so I explicitly declared the windows-latest architecture options

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you - adopted exactly this solution after some internal discussion (and before seeing this comment - sorry).

exclude:
- os: ubuntu-latest
python-architecture: arm64
- os: ubuntu-latest
python-architecture: x86
- os: windows-latest
python-architecture: arm64
- os: macos-latest
python-architecture: x86
- os: ubuntu-latest
- os: macos-latest
python-architecture: x64
- os: macos-13
python-architecture: x86
- os: macos-13
python-architecture: arm64

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

steps:
- name: Install Linux packages for Qt support
run: |
sudo apt-get update
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-cursor0
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-shape0
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v5
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 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)
- name: Install test dependencies and Traits from PyPI sdist
run: |
python -m pip install --no-binary traits numpy PySide6 setuptools Sphinx traits traitsui
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
python -m pip install --no-binary traits defusedxml numpy setuptools Sphinx traits traitsui
- name: Create clean test directory
run: |
mkdir testdir
- 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)
- name: Test Traits package
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.8', '3.9', '3.10', '3.11', '3.12']
python-architecture: [x86, x64]
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
python-architecture: [x86, x64, arm64]
exclude:
- os: ubuntu-latest
python-architecture: arm64
- os: ubuntu-latest
python-architecture: x86
- os: windows-latest
python-architecture: arm64
- os: macos-latest
python-architecture: x86
- os: ubuntu-latest
- os: macos-latest
python-architecture: x64
- os: macos-13
python-architecture: x86
- os: macos-13
python-architecture: arm64

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

steps:
- name: Install Linux packages for Qt support
run: |
sudo apt-get update
sudo apt-get install libegl1
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-cursor0
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-shape0
if: runner.os == 'Linux'
- name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }})
uses: actions/setup-python@v5
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 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)
- name: Install test dependencies and Traits from PyPI wheel
run: |
python -m pip install --only-binary traits numpy PySide6 setuptools Sphinx traits traitsui
if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86'
python -m pip install --only-binary traits defusedxml numpy setuptools Sphinx traits traitsui
- name: Create clean test directory
run: |
mkdir testdir
- 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)
- name: Test Traits package
run: cd testdir && python -m unittest discover -v traits
if: matrix.os != 'ubuntu-latest'
Loading