Skip to content

Adjust for QuPath 0.5.0 #274

Adjust for QuPath 0.5.0

Adjust for QuPath 0.5.0 #274

Workflow file for this run

name: paquo ci
on:
push:
branches:
- main
tags: v[0-9]+.[0-9]+.[0-9]+
pull_request: {}
env:
QUPATH_VERSION: 0.5.0
jobs:
# RUN PYTEST ON PAQUO SOURCE
tests:
name: pytest ${{ matrix.os }}::py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 8
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.12"]
include:
# we'll test the python support on ubuntu
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.12'
- os: ubuntu-latest
python-version: '3.9'
- os: ubuntu-latest
python-version: '3.8'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install paquo
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Restore qupath cache
uses: actions/cache@v3
env:
CACHE_NUMBER: 0
with:
path: ./qupath/download
key: ${{ runner.os }}-qupath-v${{ env.CACHE_NUMBER }}
- name: Install qupath and set PAQUO_QUPATH_DIR
shell: bash
run: |
python -c "import os; os.makedirs('qupath/download', exist_ok=True)"
python -c "import os; os.makedirs('qupath/apps', exist_ok=True)"
python -m paquo get_qupath --install-path ./qupath/apps --download-path ./qupath/download ${{ env.QUPATH_VERSION }} | grep -v "^#" | sed "s/^/PAQUO_QUPATH_DIR=/" >> $GITHUB_ENV
- name: Test with pytest
run: |
pytest --cov=./paquo --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: paquo
# RUN MYPY STATIC TYPE ANALYSIS ON PAQUO SOURCE
typing:
name: mypy type analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
pip install ome_types || true
- name: Run mypy
run: |
mypy paquo
# DEPLOY PAQUO TO TEST.PYPI ON SUCCESS
testdeploy:
needs: [tests, typing]
name: deploy to test.pypi
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install pep517
run: >-
python -m
pip install
pep517
--user
# we'll have to remove local_scheme for pushes to test.pypi pep440
- name: Get version without local_scheme
id: non_local_version
run: |
python setup.py --version | awk -F+ '{print "::set-output name=version::"$1}'
- name: Build a binary wheel and a source tarball
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.non_local_version.outputs.version }}
run: >-
python -m
pep517.build
--source
--binary
--out-dir dist/
.
# push all versions on master to test.pypi.org
- name: Publish package to TestPyPI
continue-on-error: true
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
# DEPLOY PAQUO TO PYPI ON SUCCESS
deploy:
needs: [tests, typing]
name: deploy to pypi
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install pep517
run: >-
python -m
pip install
pep517
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
pep517.build
--source
--binary
--out-dir dist/
.
# push all tagged versions to pypi.org
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}