Skip to content

TEST: Remove GitHub test build for Python 3.8 #342

TEST: Remove GitHub test build for Python 3.8

TEST: Remove GitHub test build for Python 3.8 #342

name: Build, test, package
on: [push,pull_request]
jobs:
test-python:
runs-on: ubuntu-20.04
strategy:
max-parallel: 2
matrix:
python-version: ["3.6", "3.7", "3.9"]
include:
- flake8-python-git-tag: ""
- pooch-python-git-tag: ""
- pytest-python-git-tag: ""
steps:
- uses: actions/checkout@v2
- name: 'Free up disk space'
run: |
# Workaround for https://github.com/actions/virtual-environments/issues/709
df -h
sudo apt-get clean
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
sudo apt update
sudo apt install openslide-tools python3-openslide
python -m pip install --upgrade pip setuptools wheel
pip install 'flake8${{ matrix.flake8-python-git-tag }}' 'pooch${{ matrix.pooch-python-git-tag }}' 'pytest${{ matrix.pytest-python-git-tag }}'
pip install --upgrade 'large-image[bioformats,ometiff,openjpeg,openslide,tiff]' 'scikit_image' --find-links https://girder.github.io/large_image_wheels
pip install --upgrade typing-extensions
- name: Install histomics_stream
run: |
pip install .[tensorflow,torch,zarr]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd test
pytest
shell: bash
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Set up Python "3.9"
uses: actions/setup-python@v1
with:
python-version: "3.9"
- name: Install pypa/build
run: >-
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: >-
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}