Skip to content

Commit

Permalink
workflows: build with Python build package
Browse files Browse the repository at this point in the history
It's the build tool currently recommended by PyPA.  Since it builds in
a venv, we can stop installing some dependencies.

Signed-off-by: Benjamin Gilbert <bgilbert@cs.cmu.edu>
  • Loading branch information
bgilbert committed Nov 1, 2023
1 parent b893ba2 commit 37f6fb9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install Python tools
run: |
python -m pip install --upgrade pip
pip install jinja2 pytest setuptools
pip install build jinja2 pytest
- name: Install OpenSlide
run: |
case "${{ matrix.os }}" in
Expand All @@ -52,8 +52,10 @@ jobs:
brew install openslide
;;
esac
- name: Build wheel
run: python -m build -w
- name: Install
run: pip install .
run: pip install dist/*.whl
- name: Run tests
run: pytest -v
- name: Tile slide
Expand All @@ -80,7 +82,7 @@ jobs:
- name: Install Python tools
run: |
python -m pip install --upgrade pip
pip install flask Pillow pytest setuptools wheel
pip install build flask pytest
- name: Install OpenSlide
run: |
mkdir -p c:\\openslide
Expand All @@ -91,13 +93,13 @@ jobs:
echo "OPENSLIDE_PATH=c:\\openslide\\${zipname}\\bin" >> $GITHUB_ENV
- name: Build wheel
run: |
python setup.py bdist_wheel
python -m build -w
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 -e .
run: pip install artifacts/${basename}/*.whl
- name: Run tests
# Reads OPENSLIDE_PATH
run: pytest -v
Expand Down

0 comments on commit 37f6fb9

Please sign in to comment.