From 28202a01803aafe7a87a981415b2b92a353c3cbd Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 11:47:56 -0500 Subject: [PATCH 01/12] Update CI workflow to include reusable test configurations --- .github/workflows/ci.yml | 111 ++++++++------------------------------- 1 file changed, 22 insertions(+), 89 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ddce5a8..50caf3ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,105 +19,38 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - run: pip install check-manifest && check-manifest + - run: pipx run check-manifest test: - name: ${{ matrix.platform }} (${{ matrix.python-version }}) - runs-on: ${{ matrix.platform }} + uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main + with: + os: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} + pip-force-installs: ${{ matrix.pydantic }} + qt: ${{ matrix.qt }} + extras: ${{ matrix.qt == '' && 'test' || 'test,test-qt' }} strategy: fail-fast: false matrix: - python-version: ["3.8", "3.10", "3.11"] - platform: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.8", "3.10", "3.12"] + os: [ubuntu-latest, macos-latest, windows-latest] + pydantic: [""] + qt: ["", PyQt5, PyQt6, PySide2, PySide6] include: + - python-version: "3.9" + platform: "ubuntu-latest" + - python-version: "3.11" + platform: "ubuntu-latest" - python-version: "3.12" platform: "ubuntu-latest" - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -e .[test] - - - name: Test - run: pytest -s --color=yes - - test-pydantic1: - name: pydantic1 (py${{ matrix.python-version }}) - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.8", "3.10", "3.11"] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -e .[test] - pip install 'pydantic<2' - - - name: Test - run: pytest --color=yes --cov=app_model --cov-report=xml - - - name: Coverage - uses: codecov/codecov-action@v3 - - test-qt: - name: ${{ matrix.platform }} ${{ matrix.qt-backend }} (${{ matrix.python-version }}) - runs-on: ${{ matrix.platform }} - strategy: - fail-fast: false - matrix: - python-version: ["3.10"] - platform: [macos-latest, ubuntu-latest, windows-latest] - qt-backend: [PyQt5, PyQt6, PySide2, PySide6] - include: + pydantic: "'pydantic<2'" + - python-version: "3.8" + platform: "ubuntu-latest" + pydantic: "'pydantic<2'" - python-version: "3.8" platform: "ubuntu-latest" qt-backend: "PyQt5==5.12" - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - uses: tlambert03/setup-qt-libs@v1 - - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -e .[test,test-qt] - python -m pip install ${{ matrix.qt-backend }} - - - name: Test - uses: aganders3/headless-gui@v1 - with: - run: python -m pytest -s --cov=app_model --cov-report=xml --cov-report=term-missing --color=yes - - - name: Coverage - uses: codecov/codecov-action@v3 - test_napari: name: napari (${{ matrix.napari-version }}, ${{ matrix.qt-backend }}) runs-on: ubuntu-latest @@ -159,8 +92,8 @@ jobs: deploy: name: Deploy - needs: [check-manifest, test, test-qt, test_napari] - if: "success() && startsWith(github.ref, 'refs/tags/')" + needs: [check-manifest, test, test_napari] + if: success() && startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest permissions: id-token: write From b0e5aa658d0895d1466562c691450d52a57d9862 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 11:59:30 -0500 Subject: [PATCH 02/12] exclude pyside2 on py312 --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50caf3ca..a3eaa626 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,9 @@ jobs: - python-version: "3.8" platform: "ubuntu-latest" qt-backend: "PyQt5==5.12" + exclude: + - qt: PySide2 + python-version: "3.12" test_napari: name: napari (${{ matrix.napari-version }}, ${{ matrix.qt-backend }}) From 765f2f74c10dbfd50aca849e13e1294588e85630 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 13:42:34 -0500 Subject: [PATCH 03/12] fix os --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3eaa626..861c40ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,17 +38,17 @@ jobs: qt: ["", PyQt5, PyQt6, PySide2, PySide6] include: - python-version: "3.9" - platform: "ubuntu-latest" + os: "ubuntu-latest" - python-version: "3.11" - platform: "ubuntu-latest" + os: "ubuntu-latest" - python-version: "3.12" - platform: "ubuntu-latest" + os: "ubuntu-latest" pydantic: "'pydantic<2'" - python-version: "3.8" - platform: "ubuntu-latest" + os: "ubuntu-latest" pydantic: "'pydantic<2'" - python-version: "3.8" - platform: "ubuntu-latest" + os: "ubuntu-latest" qt-backend: "PyQt5==5.12" exclude: - qt: PySide2 From db4bea36d1b2d0c1a4afb938703c5d325c90ce06 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 14:55:16 -0500 Subject: [PATCH 04/12] update --- .github/workflows/ci.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 861c40ef..f4d58e7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,33 +2,28 @@ name: CI on: push: - branches: - - main - tags: - - "v*" - pull_request: {} + branches: [main] + tags: [v*] + pull_request: workflow_dispatch: + schedule: + - cron: "0 0 * * 0" # weekly concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - check-manifest: - name: Check Manifest - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: pipx run check-manifest - test: uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - pip-force-installs: ${{ matrix.pydantic }} + pip-post-installs: ${{ matrix.pydantic }} qt: ${{ matrix.qt }} extras: ${{ matrix.qt == '' && 'test' || 'test,test-qt' }} + pip-pre: ${{ github.event_name == 'schedule' }} + report-failures: ${{ github.event_name == 'schedule' }} strategy: fail-fast: false matrix: @@ -93,6 +88,13 @@ jobs: working-directory: napari run: python -m pytest napari/_qt napari/_app_model --color=yes -x + check-manifest: + name: Check Manifest + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: pipx run check-manifest + deploy: name: Deploy needs: [check-manifest, test, test_napari] @@ -103,6 +105,8 @@ jobs: contents: write steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v4 From 47cd6ec72d8b24ef4919963688f901ee04f19347 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 15:49:08 -0500 Subject: [PATCH 05/12] add for napari too --- .github/workflows/ci.yml | 48 +++++++++------------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4d58e7d..057161c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: pull_request: workflow_dispatch: schedule: - - cron: "0 0 * * 0" # weekly + - cron: "0 0 * * *" # run once a day concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -48,45 +48,19 @@ jobs: exclude: - qt: PySide2 python-version: "3.12" - + test_napari: - name: napari (${{ matrix.napari-version }}, ${{ matrix.qt-backend }}) - runs-on: ubuntu-latest + uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@main + with: + package_to_test: napari/napari + package_to_test_ref: ${{ matrix.napari-version }} + package-extras: 'testing' + qt: ${{ matrix.qt }} + pytest-args: 'napari/_qt napari/_app_model' strategy: matrix: - napari-version: [""] # "" is HEAD - qt-backend: [pyqt5, pyside2] - - steps: - - uses: actions/checkout@v4 - with: - path: app-model - - - uses: actions/checkout@v4 - with: - repository: napari/napari - path: napari - fetch-depth: 0 - ref: ${{ matrix.napari-version }} - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - uses: tlambert03/setup-qt-libs@v1 - - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -e app-model - python -m pip install -e napari[testing,${{ matrix.qt-backend }}] - - - name: Test - uses: aganders3/headless-gui@v1 - with: - working-directory: napari - run: python -m pytest napari/_qt napari/_app_model --color=yes -x + napari-version: ["", "v0.4.18"] + qt: ["pyqt5", "pyside2"] check-manifest: name: Check Manifest From b33058f1f3f2d3e883c39641d7c725cbac19003f Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 15:50:46 -0500 Subject: [PATCH 06/12] specify python version --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 057161c4..73e2c996 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,7 @@ jobs: package-extras: 'testing' qt: ${{ matrix.qt }} pytest-args: 'napari/_qt napari/_app_model' + python-version: "3.10" strategy: matrix: napari-version: ["", "v0.4.18"] From f3a495894f909d7159b2e6c93edf4eadf0e0bb05 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 16:00:57 -0500 Subject: [PATCH 07/12] force From 285d59838cf2514651a532939c03ddc638b4f8e3 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 16:10:42 -0500 Subject: [PATCH 08/12] skip async --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73e2c996..05113158 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,9 +56,10 @@ jobs: package_to_test_ref: ${{ matrix.napari-version }} package-extras: 'testing' qt: ${{ matrix.qt }} - pytest-args: 'napari/_qt napari/_app_model' + pytest-args: "napari/_qt napari/_app_model -k 'not async'" python-version: "3.10" strategy: + fail-fast: false matrix: napari-version: ["", "v0.4.18"] qt: ["pyqt5", "pyside2"] From a9a44fca9483ab6b54a3c6de852f1c47536fe34c Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 16:14:15 -0500 Subject: [PATCH 09/12] swap quotes --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05113158..b342abbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: package_to_test_ref: ${{ matrix.napari-version }} package-extras: 'testing' qt: ${{ matrix.qt }} - pytest-args: "napari/_qt napari/_app_model -k 'not async'" + pytest-args: 'napari/_qt napari/_app_model -k "not async"' python-version: "3.10" strategy: fail-fast: false From 4a63eae7b5e08728e97034ad56f52fd92307235d Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 16:39:05 -0500 Subject: [PATCH 10/12] not qt dims 2 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b342abbc..a18a27b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: package_to_test_ref: ${{ matrix.napari-version }} package-extras: 'testing' qt: ${{ matrix.qt }} - pytest-args: 'napari/_qt napari/_app_model -k "not async"' + pytest-args: 'napari/_qt napari/_app_model -k "not async and not qt_dims_2"' python-version: "3.10" strategy: fail-fast: false From c3b7a48c9e8ff331577d36fdd2563b78022f5aeb Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 6 Nov 2023 11:51:54 -0500 Subject: [PATCH 11/12] update version --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a18a27b3..2b421735 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,14 @@ concurrency: jobs: test: - uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main + uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v1 with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} pip-post-installs: ${{ matrix.pydantic }} qt: ${{ matrix.qt }} extras: ${{ matrix.qt == '' && 'test' || 'test,test-qt' }} - pip-pre: ${{ github.event_name == 'schedule' }} + pip-install-pre-release: ${{ github.event_name == 'schedule' }} report-failures: ${{ github.event_name == 'schedule' }} strategy: fail-fast: false @@ -50,7 +50,7 @@ jobs: python-version: "3.12" test_napari: - uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@main + uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v1 with: package_to_test: napari/napari package_to_test_ref: ${{ matrix.napari-version }} From 972884866dd36aa479d7181e9ce3a27c1b57cfad Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 6 Nov 2023 13:33:09 -0500 Subject: [PATCH 12/12] updates --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b421735..42357387 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,9 +52,9 @@ jobs: test_napari: uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v1 with: - package_to_test: napari/napari - package_to_test_ref: ${{ matrix.napari-version }} - package-extras: 'testing' + dependency-repo: napari/napari + dependency-ref: ${{ matrix.napari-version }} + dependency-extras: 'testing' qt: ${{ matrix.qt }} pytest-args: 'napari/_qt napari/_app_model -k "not async and not qt_dims_2"' python-version: "3.10"