Skip to content

Commit

Permalink
fix: improve wheel installation in CI
Browse files Browse the repository at this point in the history
- Added debug output to list available wheels
- Added error handling for missing wheel files
- Fixed wheel file pattern matching
- Improved error messages for wheel installation failures
- Added explicit wheel file checks before installation

These changes help diagnose and fix wheel installation issues in the
CI pipeline, particularly for Linux builds.
  • Loading branch information
dirvine committed Nov 29, 2024
1 parent 21b5c7c commit f27e16f
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ jobs:
- name: Install built wheel
if: matrix.target == 'x86_64'
run: |
WHEEL_FILE=$(ls dist/${{ env.PACKAGE_NAME }}-cp`echo ${{ matrix.python-version }} | tr -d '.'`*.whl)
# List all wheels to debug
echo "Available wheels:"
ls -la dist/
# Try to find the wheel file
WHEEL_FILE=$(ls dist/${{ env.PACKAGE_NAME }}-cp`echo ${{ matrix.python-version }} | tr -d '.'`*.whl || true)
if [ -z "$WHEEL_FILE" ]; then
echo "No matching wheel found for Python ${{ matrix.python-version }}"
exit 1
fi
pip install $WHEEL_FILE --force-reinstall
pip install pytest
pytest -v
Expand Down Expand Up @@ -129,10 +138,20 @@ jobs:
githubToken: ${{ github.token }}
install: |
apt-get update
apt-get install -y --no-install-recommends python${{ matrix.python-version }} python${{ matrix.python-version }}-pip
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip
run: |
pip3 install ${{ env.PACKAGE_NAME }}-cp`echo ${{ matrix.python-version }} | tr -d '.'`-*.whl --no-index --find-links dist/ --force-reinstall
# List all wheels to debug
echo "Available wheels:"
ls -la dist/
# Try to find the wheel file
WHEEL_FILE=$(ls dist/${{ env.PACKAGE_NAME }}-cp`echo ${{ matrix.python-version }} | tr -d '.'`*.whl || true)
if [ -z "$WHEEL_FILE" ]; then
echo "No matching wheel found for Python ${{ matrix.python-version }}"
exit 1
fi
pip3 install $WHEEL_FILE --force-reinstall
pip install pytest
pytest -v
- name: Upload wheels
Expand Down

0 comments on commit f27e16f

Please sign in to comment.