From d681993aee74135ba8828428eb8190986377439a Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 11:06:32 -0500 Subject: [PATCH 1/8] ci: try reusable --- .github/workflows/test.yml | 67 ++++++++------------------------------ pyproject.toml | 4 +-- 2 files changed, 15 insertions(+), 56 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed5b41f5..6aae727f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,16 +22,24 @@ jobs: python-version: "3.x" - run: pip install check-manifest && check-manifest - test-linux: - name: py${{ matrix.python-version }} on ${{ matrix.platform }} ${{ matrix.backend }} ${{ matrix.pydantic }} - runs-on: ${{ matrix.platform }} - + test: + name: Test + uses: pyapp-kit/.github/.github/workflows/reusable-ci.yml@main + with: + os: ${{ matrix.platform }} + python-version: ${{ matrix.python-version }} + qt: ${{ matrix.backend }} + pip-force-installs: ${{ matrix.pydantic }} + extras: ${{ matrix.backend == '' && 'test' || 'test,testqt' }} + fail-on-coverage-error: true + hatch-build-hooks-enable: ${{ matrix.compile }} strategy: fail-fast: false matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] platform: [ubuntu-latest, macos-latest, windows-latest] backend: [""] + compile: [true, false] include: - platform: ubuntu-latest python-version: "3.10" @@ -52,58 +60,9 @@ jobs: python-version: "3.11" pydantic: "pydantic<2" - platform: ubuntu-latest - python-version: "3.12-dev" + python-version: "3.12" backend: "" - 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.4 - if: matrix.backend != '' - - - name: Install ${{ matrix.backend }} - if: matrix.backend != '' - run: | - python -m pip install -e .[testqt] - python -m pip install ${{ matrix.backend }} - - - name: install - run: | - python -m pip install -U pip - python -m pip install -e .[test] - python -c "import sys, psygnal; sys.exit(1 if psygnal._compiled else 0)" - - - name: downgrade pydantic - if: matrix.pydantic != '' - run: python -m pip install "${{ matrix.pydantic }}" - - - name: test uncompiled - uses: aganders3/headless-gui@v1 - with: - run: pytest --color=yes --cov=psygnal --cov-report=xml - - - name: compile and retest - run: | - python -m pip install -e . - python -c "import sys, psygnal; sys.exit(0 if psygnal._compiled else 1)" - env: - HATCH_BUILD_HOOKS_ENABLE: "1" - - - name: test compiled - if: matrix.python-version != '3.12-dev' - uses: aganders3/headless-gui@v1 - with: - run: pytest --color=yes --cov=psygnal --cov-report=xml --cov-append - - - uses: codecov/codecov-action@v3 - with: - fail_ci_if_error: true - verbose: true - test-magicgui: name: test magicgui runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index b37d077b..3f804296 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -211,8 +211,8 @@ exclude_lines = [ "raise NotImplementedError()", ] [tool.coverage.run] -source = ["src"] -omit = ["src/psygnal/_pyinstaller_util/hook-psygnal.py"] +source = ["psygnal"] +omit = ["*/_pyinstaller_util/hook-psygnal.py"] # https://github.com/mgedmin/check-manifest#configuration [tool.check-manifest] From 2696e7711e8428366e39213195b9955aab347976 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sun, 5 Nov 2023 11:33:01 -0500 Subject: [PATCH 2/8] fix string --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6aae727f..9a984e46 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: test: name: Test - uses: pyapp-kit/.github/.github/workflows/reusable-ci.yml@main + uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main with: os: ${{ matrix.platform }} python-version: ${{ matrix.python-version }} @@ -55,10 +55,10 @@ jobs: backend: "PySide6" - platform: ubuntu-latest python-version: "3.11" - pydantic: "pydantic<2" + pydantic: "'pydantic<2'" - platform: windows-latest python-version: "3.11" - pydantic: "pydantic<2" + pydantic: "'pydantic<2'" - platform: ubuntu-latest python-version: "3.12" backend: "" From 50c9fdb25a595fbc98a62fc7aa348aa82ba12fcf Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 6 Nov 2023 13:32:34 -0500 Subject: [PATCH 3/8] update --- .github/workflows/test.yml | 85 ++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a984e46..e3c8c1a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,10 +2,11 @@ name: CI on: push: - branches: - - main + branches: [main] pull_request: {} workflow_dispatch: + schedule: + - cron: "0 0 * * 0" # run once a week concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -24,74 +25,60 @@ jobs: test: name: Test - uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main + uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v1 with: - os: ${{ matrix.platform }} + os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - qt: ${{ matrix.backend }} - pip-force-installs: ${{ matrix.pydantic }} - extras: ${{ matrix.backend == '' && 'test' || 'test,testqt' }} + qt: ${{ matrix.qt }} + pip-post-installs: ${{ matrix.pydantic }} + extras: ${{ matrix.qt == '' && 'test' || 'test,testqt' }} fail-on-coverage-error: true hatch-build-hooks-enable: ${{ matrix.compile }} + pip-install-pre-release: ${{ github.event_name == 'schedule' }} + report-failures: ${{ github.event_name == 'schedule' }} strategy: fail-fast: false matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - platform: [ubuntu-latest, macos-latest, windows-latest] - backend: [""] + os: [ubuntu-latest, macos-latest, windows-latest] + qt: [""] compile: [true, false] include: - - platform: ubuntu-latest + - os: ubuntu-latest python-version: "3.10" - backend: "PyQt5" - - platform: macos-latest + qt: "PyQt5" + - os: macos-latest python-version: "3.10" - backend: "PyQt6" - - platform: ubuntu-latest + qt: "PyQt6" + - os: ubuntu-latest python-version: "3.10" - backend: "PySide2" - - platform: macos-latest + qt: "PySide2" + - os: macos-latest python-version: "3.10" - backend: "PySide6" - - platform: ubuntu-latest + qt: "PySide6" + - os: ubuntu-latest python-version: "3.11" pydantic: "'pydantic<2'" - - platform: windows-latest + - os: windows-latest python-version: "3.11" pydantic: "'pydantic<2'" - - platform: ubuntu-latest + - os: ubuntu-latest python-version: "3.12" - backend: "" + qt: "" test-magicgui: - name: test magicgui - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - path: psygnal - - - uses: actions/checkout@v4 - with: - repository: pyapp-kit/magicgui - path: magicgui - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - uses: tlambert03/setup-qt-libs@v1 - - name: install - run: | - python -m pip install -U pip - pip install -e magicgui[testing,pyside2] - pip install -e psygnal - - - name: test magicgui - uses: aganders3/headless-gui@v1 - with: - run: python -m pytest magicgui/tests -v --color=yes + uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v1 + with: + dependency-repo: pyapp-kit/magicgui + dependency-ref: ${{ matrix.napari-version }} + dependency-extras: 'testing' + qt: ${{ matrix.qt }} + python-version: "3.10" + strategy: + fail-fast: false + matrix: + napari-version: ["", "v0.4.18"] + qt: ["pyside2"] typing: runs-on: ubuntu-latest From 825f22e44168891a73036104ccc7e505b334e11f Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 14 Nov 2023 07:42:20 -0500 Subject: [PATCH 4/8] fix magicgui --- .github/workflows/test.yml | 43 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3c8c1a7..c7f8010f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,9 +29,7 @@ jobs: with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - qt: ${{ matrix.qt }} pip-post-installs: ${{ matrix.pydantic }} - extras: ${{ matrix.qt == '' && 'test' || 'test,testqt' }} fail-on-coverage-error: true hatch-build-hooks-enable: ${{ matrix.compile }} pip-install-pre-release: ${{ github.event_name == 'schedule' }} @@ -39,45 +37,48 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, macos-latest, windows-latest] - qt: [""] compile: [true, false] include: - - os: ubuntu-latest - python-version: "3.10" - qt: "PyQt5" - - os: macos-latest - python-version: "3.10" - qt: "PyQt6" - - os: ubuntu-latest - python-version: "3.10" - qt: "PySide2" - - os: macos-latest - python-version: "3.10" - qt: "PySide6" - os: ubuntu-latest python-version: "3.11" pydantic: "'pydantic<2'" - os: windows-latest python-version: "3.11" pydantic: "'pydantic<2'" - - os: ubuntu-latest - python-version: "3.12" - qt: "" + + test-qt: + name: Test Qt + uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v1 + with: + os: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} + qt: ${{ matrix.qt }} + extras: 'test,testqt' + hatch-build-hooks-enable: ${{ matrix.compile }} + pip-install-pre-release: ${{ github.event_name == 'schedule' }} + report-failures: ${{ github.event_name == 'schedule' }} + strategy: + fail-fast: false + matrix: + python-version: ["3.10"] + os: [macos-latest, windows-latest] + qt: [PyQt5, PyQt6, PySide2, PySide6] + compile: [true, false] test-magicgui: uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v1 with: dependency-repo: pyapp-kit/magicgui - dependency-ref: ${{ matrix.napari-version }} + dependency-ref: ${{ matrix.dependency-version }} dependency-extras: 'testing' qt: ${{ matrix.qt }} python-version: "3.10" strategy: fail-fast: false matrix: - napari-version: ["", "v0.4.18"] + dependency-version: ["", "v0.6.0"] qt: ["pyside2"] typing: From e6c51b1f7681a54df163edff9f1075ddda3a9adf Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 14 Nov 2023 07:48:56 -0500 Subject: [PATCH 5/8] test different version --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7f8010f..aecc98d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,13 +73,13 @@ jobs: dependency-repo: pyapp-kit/magicgui dependency-ref: ${{ matrix.dependency-version }} dependency-extras: 'testing' - qt: ${{ matrix.qt }} + qt: "pyside2" python-version: "3.10" + # pytest-args: --ignore typesafety strategy: fail-fast: false matrix: - dependency-version: ["", "v0.6.0"] - qt: ["pyside2"] + dependency-version: ["", "v0.7.0"] typing: runs-on: ubuntu-latest From f332a4fb7e6ba1efcb703f817dab88cd60b99925 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Tue, 14 Nov 2023 08:03:35 -0500 Subject: [PATCH 6/8] exclude win 312 --- .github/workflows/test.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aecc98d7..afbc56ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,14 +14,10 @@ concurrency: jobs: check-manifest: - name: Check Manifest 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: Test @@ -30,7 +26,7 @@ jobs: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} pip-post-installs: ${{ matrix.pydantic }} - fail-on-coverage-error: true + fail-on-coverage-error: false hatch-build-hooks-enable: ${{ matrix.compile }} pip-install-pre-release: ${{ github.event_name == 'schedule' }} report-failures: ${{ github.event_name == 'schedule' }} @@ -47,6 +43,9 @@ jobs: - os: windows-latest python-version: "3.11" pydantic: "'pydantic<2'" + exclude: + - os: windows-latest + python-version: "3.12" test-qt: name: Test Qt @@ -55,7 +54,7 @@ jobs: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} qt: ${{ matrix.qt }} - extras: 'test,testqt' + extras: "test,testqt" hatch-build-hooks-enable: ${{ matrix.compile }} pip-install-pre-release: ${{ github.event_name == 'schedule' }} report-failures: ${{ github.event_name == 'schedule' }} @@ -71,15 +70,9 @@ jobs: uses: pyapp-kit/workflows/.github/workflows/test-dependents.yml@v1 with: dependency-repo: pyapp-kit/magicgui - dependency-ref: ${{ matrix.dependency-version }} - dependency-extras: 'testing' + dependency-extras: "testing" qt: "pyside2" - python-version: "3.10" - # pytest-args: --ignore typesafety - strategy: - fail-fast: false - matrix: - dependency-version: ["", "v0.7.0"] + python-version: "3.11" typing: runs-on: ubuntu-latest From 564b0a20972961da271d44c1cda8325c710e5e3c Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 15 Nov 2023 07:38:07 -0500 Subject: [PATCH 7/8] use py310 for testing magicgui --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index afbc56ff..5fae3675 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: dependency-repo: pyapp-kit/magicgui dependency-extras: "testing" qt: "pyside2" - python-version: "3.11" + python-version: "3.10" typing: runs-on: ubuntu-latest From 49390ade8511508466b4768598de75431bd92ddd Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Wed, 15 Nov 2023 07:40:03 -0500 Subject: [PATCH 8/8] change matrix --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5fae3675..f361f38d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: compile: [true, false] include: - os: ubuntu-latest - python-version: "3.11" + python-version: "3.12" pydantic: "'pydantic<2'" - os: windows-latest python-version: "3.11" @@ -46,6 +46,10 @@ jobs: exclude: - os: windows-latest python-version: "3.12" + - os: windows-latest + python-version: "3.7" + - os: macos-latest + python-version: "3.7" test-qt: name: Test Qt