Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 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
11 changes: 4 additions & 7 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.x"
- run: |
python -m pip install --upgrade pip
python -m pip install -e .[docs]
enable-cache: true

- name: Deploy docs to GitHub Pages
if: github.event_name == 'push'
run: mkdocs gh-deploy --strict --force
run: uv run --group docs mkdocs gh-deploy --strict --force

- name: Test that docs build without error
if: github.event_name == 'pull_request'
run: mkdocs build --strict
run: uv run --group docs mkdocs build --strict
110 changes: 61 additions & 49 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,79 +15,92 @@ on:

jobs:
test:
name: Test
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
qt: ${{ matrix.qt }}
pip-install-pre-release: ${{ github.event_name == 'schedule' }}
coverage-upload: artifact
name: ${{ matrix.os }} (${{ matrix.python-version }}) ${{ matrix.add-group || '' }} ${{ matrix.resolution || ''}}
runs-on: ${{ matrix.os }}
env:
UV_PRERELEASE: ${{ github.event_name == 'schedule' && 'allow' || 'if-necessary-or-explicit' }}
UV_NO_SYNC: 1
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
qt: [pyqt6, pyside6]
add-group: [pyqt6, pyside6]
include:
- os: windows-latest
python-version: "3.11"
resolution: "lowest-direct"
add-group: pyside6
- python-version: "3.9"
os: ubuntu-latest
qt: pyqt5
add-group: pyqt5
- python-version: "3.9"
os: ubuntu-latest
qt: pyside2
- python-version: "3.9"
os: macos-13
qt: pyside2
- python-version: "3.9"
os: macos-13
qt: pyqt5
- python-version: "3.9"
add-group: pyside2
- python-version: "3.11"
os: windows-latest
qt: pyqt5
add-group: pyqt5
- python-version: "3.10"
os: ubuntu-latest
qt: pyside2
add-group: pyside2
- python-version: "3.12"
os: ubuntu-latest
qt: pyqt6
add-group: pyqt6
- python-version: "3.12"
os: ubuntu-latest
qt: pyside6
add-group: pyside6
- python-version: "3.13"
os: ubuntu-latest
qt: pyside6
add-group: pyside6
- python-version: "3.13"
os: windows-latest
qt: pyqt6
add-group: pyqt6
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

test-min-reqs:
name: Test min reqs
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ubuntu-latest
python-version: ${{ matrix.python-version }}
qt: pyqt5
pip-install-min-reqs: true
coverage-upload: artifact
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

test-pydantic1:
name: Test pydantic 1
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@v2
with:
os: ubuntu-latest
python-version: 3.11
qt: pyqt6
pip-post-installs: '"pydantic<2"'
coverage-upload: artifact
- uses: pyvista/setup-headless-display-action@v4
with:
qt: true

- name: Install Dependencies
run: uv sync --no-dev --group test --group ${{ matrix.add-group || 'test' }} --resolution ${{ matrix.resolution || 'highest'}}

- name: 🧪 Run Tests
run: uv run coverage run -p -m pytest -v

# If something goes wrong with --pre tests, we can open an issue in the repo
- name: 📝 Report --pre Failures
if: failure() && github.event_name == 'schedule'
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLATFORM: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
RUN_ID: ${{ github.run_id }}
TITLE: "[test-bot] pip install --pre is failing"
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true

- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: covreport-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.add-group }}-${{ matrix.resolution }}
path: ./.coverage*
include-hidden-files: true

upload_coverage:
if: always()
needs: [test, test-min-reqs, test-pydantic1]
needs: [test]
uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2
secrets: inherit

Expand All @@ -97,7 +110,6 @@ jobs:
dependency-repo: ${{ matrix.package }}
dependency-ref: ${{ matrix.package-version }}
dependency-extras: ${{ matrix.package-extras || 'testing' }}
host-extras: "testing"
qt: pyqt5
python-version: "3.10"
post-install-cmd: "python -m pip install pytest-pretty lxml_html_clean" # just for napari
Expand All @@ -107,7 +119,7 @@ jobs:
matrix:
include:
- package: napari/napari
pytest-args: napari/_tests/test_magicgui.py
pytest-args: src/napari/_tests/test_magicgui.py --import-mode=importlib
- package: napari/napari
package-version: "v0.4.19.post1"
pytest-args: napari/_tests/test_magicgui.py
Expand Down
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ ci:

repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
rev: v0.24.1
hooks:
- id: validate-pyproject

- repo: https://github.com/crate-ci/typos
rev: v1.30.0
rev: v1.33.1
hooks:
- id: typos

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.9
rev: v0.11.12
hooks:
- id: ruff
args: ["--fix", "--unsafe-fixes"]
- id: ruff-check
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
rev: v1.16.0
hooks:
- id: mypy
files: "^src/"
Expand Down
Loading
Loading