From 0dce06a969196031994baa289e60f181b8169e7e Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 1 Nov 2023 01:45:39 -0500 Subject: [PATCH] workflows: build with Python `build` package It's the build tool currently recommended by PyPA. Signed-off-by: Benjamin Gilbert --- .github/workflows/python.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index d5d8287a..f6cc4099 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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 @@ -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 @@ -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 @@ -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