From f8770d2657b1df2137127f89d4afa1ccebe80d38 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 08:36:35 +0100 Subject: [PATCH 1/8] Fix architectures in PyPI workflow --- .github/workflows/test-from-pypi.yml | 77 ++++++++-------------------- 1 file changed, 20 insertions(+), 57 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index 0a1e6a4cf..4e4a11c1c 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -6,112 +6,75 @@ 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] + os: [ubuntu-latest, windows-latest, macos-latest, macos-13] python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - python-architecture: [x86, x64] + python-architecture: [x86, x64, arm64] exclude: - os: macos-latest python-architecture: x86 + - os: macos-latest + python-architecture: x64 + - os: macos-13 + python-architecture: x86 + - os: macos-13 + python-architecture: arm64 - os: ubuntu-latest python-architecture: x86 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) + - name: Install test dependencies and Traits from PyPI sdist 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) - run: | - python -m pip install --no-binary traits numpy PySide6 setuptools Sphinx traits traitsui - if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86' - 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] + os: [ubuntu-latest, windows-latest, macos-latest, macos-13] python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - python-architecture: [x86, x64] + python-architecture: [x86, x64, arm64] exclude: - os: macos-latest python-architecture: x86 + - os: macos-latest + python-architecture: x64 + - os: macos-13 + python-architecture: x86 + - os: macos-13 + python-architecture: arm64 - os: ubuntu-latest python-architecture: x86 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) + - name: Install test dependencies and Traits from PyPI wheel 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) - run: | - python -m pip install --only-binary traits numpy PySide6 setuptools Sphinx traits traitsui - if: matrix.python-version != '3.12' && matrix.python-architecture != 'x86' - 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' From ddb4da1b659da93b39222e059574b5023e8ae13f Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 08:43:20 +0100 Subject: [PATCH 2/8] Use include instead of exclude; temporarily disable the sdist-based job --- .github/workflows/test-from-pypi.yml | 84 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index 4e4a11c1c..2d36a5b4a 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -7,59 +7,59 @@ on: - cron: '27 3 8,22 * *' jobs: - test-pypi-sdist: - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-13] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - python-architecture: [x86, x64, arm64] - exclude: - - os: macos-latest - python-architecture: x86 - - os: macos-latest - python-architecture: x64 - - os: macos-13 - python-architecture: x86 - - os: macos-13 - python-architecture: arm64 - - os: ubuntu-latest - python-architecture: x86 + # test-pypi-sdist: + # strategy: + # matrix: + # os: [ubuntu-latest, windows-latest, macos-latest, macos-13] + # python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + # python-architecture: [x86, x64, arm64] + # exclude: + # - os: macos-latest + # python-architecture: x86 + # - os: macos-latest + # python-architecture: x64 + # - os: macos-13 + # python-architecture: x86 + # - os: macos-13 + # python-architecture: arm64 + # - os: ubuntu-latest + # python-architecture: x86 - runs-on: ${{ matrix.os }} + # runs-on: ${{ matrix.os }} - steps: - - 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 - run: | - python -m pip install --no-binary traits numpy setuptools Sphinx traits traitsui - - name: Create clean test directory - run: | - mkdir testdir - - name: Test Traits package - run: cd testdir && python -m unittest discover -v traits + # steps: + # - 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 + # run: | + # python -m pip install --no-binary traits numpy setuptools Sphinx traits traitsui + # - name: Create clean test directory + # run: | + # mkdir testdir + # - name: Test Traits package + # run: cd testdir && python -m unittest discover -v traits test-pypi-wheel: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-13] python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - python-architecture: [x86, x64, arm64] - exclude: - - os: macos-latest + include: + - os: windows-latest python-architecture: x86 - - os: macos-latest + - os: windows-latest python-architecture: x64 - - os: macos-13 - python-architecture: x86 - - os: macos-13 - python-architecture: arm64 - os: ubuntu-latest python-architecture: x86 + - os: ubuntu-latest + python-architecture: x64 + - os: macos-latest + python-architecture: arm64 + - os: macos-13 + python-architecture: x64 runs-on: ${{ matrix.os }} From 5d8d7b91159c6fc6fc18447000004f391913dc74 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 08:52:52 +0100 Subject: [PATCH 3/8] Switch back to exclude --- .github/workflows/test-from-pypi.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index 2d36a5b4a..5941c4617 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -47,19 +47,21 @@ jobs: strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - include: + os: [ubuntu-latest, windows-latest, macos-latest, macos-13] + python-architecture: [x86, x64, arm64] + exclude: + - os: ubuntu-latest + python-architecture: arm64 - os: windows-latest + python-architecture: arm64 + - os: macos-latest python-architecture: x86 - - os: windows-latest + - os: macos-latest python-architecture: x64 - - os: ubuntu-latest + - os: macos-13 python-architecture: x86 - - os: ubuntu-latest - python-architecture: x64 - - os: macos-latest - python-architecture: arm64 - os: macos-13 - python-architecture: x64 + python-architecture: arm64 runs-on: ${{ matrix.os }} From d7e121b19628b9eb4ff9565fed2bcc7f7be9bdf8 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 08:55:20 +0100 Subject: [PATCH 4/8] Also exclude ubuntu-latest/x86 --- .github/workflows/test-from-pypi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index 5941c4617..f55880754 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -52,6 +52,8 @@ jobs: exclude: - os: ubuntu-latest python-architecture: arm64 + - os: ubuntu-latest + python-architecture: x86 - os: windows-latest python-architecture: arm64 - os: macos-latest From 1351a989b4b2cc568d7127e802151eb961d3f920 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 09:02:22 +0100 Subject: [PATCH 5/8] Add missing test dependency --- .github/workflows/test-from-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index f55880754..e824ac686 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -36,7 +36,7 @@ jobs: # allow-prereleases: true # - name: Install test dependencies and Traits from PyPI sdist # run: | - # python -m pip install --no-binary traits numpy setuptools Sphinx traits traitsui + # python -m pip install --no-binary traits defusedxml numpy setuptools Sphinx traits traitsui # - name: Create clean test directory # run: | # mkdir testdir @@ -76,7 +76,7 @@ jobs: allow-prereleases: true - name: Install test dependencies and Traits from PyPI wheel run: | - python -m pip install --only-binary traits numpy setuptools Sphinx traits traitsui + python -m pip install --only-binary traits defusedxml numpy setuptools Sphinx traits traitsui - name: Create clean test directory run: | mkdir testdir From cc4a7cd2f083b1878af4e0e3d196a4980af2ab83 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 09:09:33 +0100 Subject: [PATCH 6/8] Uncomment the test-pypi-sdist job --- .github/workflows/test-from-pypi.yml | 70 +++++++++++++++------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index e824ac686..44ef059c6 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -7,41 +7,45 @@ on: - cron: '27 3 8,22 * *' jobs: - # test-pypi-sdist: - # strategy: - # matrix: - # os: [ubuntu-latest, windows-latest, macos-latest, macos-13] - # python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - # python-architecture: [x86, x64, arm64] - # exclude: - # - os: macos-latest - # python-architecture: x86 - # - os: macos-latest - # python-architecture: x64 - # - os: macos-13 - # python-architecture: x86 - # - os: macos-13 - # python-architecture: arm64 - # - os: ubuntu-latest - # python-architecture: x86 + test-pypi-sdist: + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + 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: macos-latest + python-architecture: x64 + - os: macos-13 + python-architecture: x86 + - os: macos-13 + python-architecture: arm64 - # runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os }} - # steps: - # - 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 - # run: | - # 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 - # run: cd testdir && python -m unittest discover -v traits + steps: + - 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 + run: | + 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 + run: cd testdir && python -m unittest discover -v traits test-pypi-wheel: strategy: From 5c3d1c747da18f09726e6ef23e82bdda47b2e97c Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 10:16:38 +0100 Subject: [PATCH 7/8] Try a different approach --- .github/workflows/test-from-pypi.yml | 34 ++++++++++++---------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index 44ef059c6..aa9937038 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -11,32 +11,26 @@ jobs: strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - 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: macos-latest - python-architecture: x64 - - os: macos-13 - python-architecture: x86 - - os: macos-13 - python-architecture: arm64 + platform: + - os: ubuntu-latest + architecture: x64 + - os: windows-latest + architecture: x64 + - os: windows-latest + architecture: x86 + - os: macos-latest + architecture: arm64 + - os: macos-13 + architecture: x64 - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform.os }} steps: - - name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }}) + - name: Set up Python ${{ matrix.python-version }} (${{ matrix.platform.architecture }}) uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.python-architecture }} + architecture: ${{ matrix.platform.architecture }} allow-prereleases: true - name: Install test dependencies and Traits from PyPI sdist run: | From 261b70a5411df3a70f37a977725ba2ff00798c11 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Wed, 8 May 2024 10:40:16 +0100 Subject: [PATCH 8/8] Apply the same approach to test-pypi-sdist --- .github/workflows/test-from-pypi.yml | 34 ++++++++++++---------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-from-pypi.yml b/.github/workflows/test-from-pypi.yml index aa9937038..fe0d4c60a 100644 --- a/.github/workflows/test-from-pypi.yml +++ b/.github/workflows/test-from-pypi.yml @@ -45,32 +45,26 @@ jobs: strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - 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: macos-latest - python-architecture: x64 - - os: macos-13 - python-architecture: x86 - - os: macos-13 - python-architecture: arm64 + platform: + - os: ubuntu-latest + architecture: x64 + - os: windows-latest + architecture: x64 + - os: windows-latest + architecture: x86 + - os: macos-latest + architecture: arm64 + - os: macos-13 + architecture: x64 - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform.os }} steps: - - name: Set up Python ${{ matrix.python-version }} (${{ matrix.python-architecture }}) + - name: Set up Python ${{ matrix.python-version }} (${{ matrix.platform.architecture }}) uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.python-architecture }} + architecture: ${{ matrix.platform.architecture }} allow-prereleases: true - name: Install test dependencies and Traits from PyPI wheel run: |