Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bgilbert committed Nov 1, 2023
1 parent e041ea0 commit 4599239
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,36 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
# setup-python Python < 3.11 doesn't support universal binaries
# https://github.com/actions/setup-python/issues/439#issuecomment-1247646682
include:
- os: macos-latest
python-version: "3.8"
brew-python: true
- os: macos-latest
python-version: "3.9"
brew-python: true
- os: macos-latest
python-version: "3.10"
brew-python: true
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: "! matrix.brew-python"
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }} (macOS fallback)
if: matrix.brew-python
run: |
brew install python${{matrix.python-version}}
python -V
pip -V
- name: Install Python tools
run: |
python -m pip install --upgrade pip
pip install build jinja2 pytest
pip install auditwheel build jinja2 pytest setuptools
- name: Install OpenSlide
run: |
case "${{ matrix.os }}" in
Expand All @@ -53,13 +72,36 @@ jobs:
;;
esac
- name: Build wheel
run: python -m build -w
run: |
python -m build -w
case "${{ matrix.os }}" in
ubuntu-*)
mv dist old
auditwheel repair --only-plat -w dist old/*whl
;;
macos-*)
if [ ! -e dist/*universal2* ]; then
echo "Wheel is not universal:"
ls dist
exit 1
fi
;;
esac
basename=openslide-python-wheels-$GITHUB_RUN_NUMBER-$(echo $GITHUB_SHA | cut -c-10)
mkdir -p "artifacts/${basename}"
mv dist/*.whl "artifacts/${basename}"
echo "basename=${basename}" >> $GITHUB_ENV
- name: Install
run: pip install dist/*.whl
run: pip install artifacts/${basename}/*.whl
- name: Run tests
run: pytest -v
- name: Tile slide
run: python examples/deepzoom/deepzoom_tile.py --viewer -o tiled tests/fixtures/small.svs
- name: Archive wheel
uses: actions/upload-artifact@v3
with:
name: ${{ env.basename }}
path: artifacts
windows:
name: Windows
needs: pre-commit
Expand Down

0 comments on commit 4599239

Please sign in to comment.