Skip to content

Commit 6de1701

Browse files
committed
update for the testing phase
1 parent 5cbbe5c commit 6de1701

1 file changed

Lines changed: 49 additions & 16 deletions

File tree

.github/workflows/build_wheels.yml

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -303,31 +303,64 @@ jobs:
303303
pip install pytest
304304
305305
- name: Install wheel and run tests
306+
shell: bash
306307
run: |
307-
# Set the platform-specific wheel tag based on the runner's OS
308-
if [[ "${{ runner.os }}" == "Linux" ]]; then
309-
PLATFORM_TAG="*manylinux*"
310-
elif [[ "${{ runner.os }}" == "Windows" ]]; then
311-
PLATFORM_TAG="*win_amd64*"
312-
elif [[ "${{ runner.os }}" == "macOS" ]]; then
313-
PLATFORM_TAG="*macosx*"
314-
fi
308+
set -euxo pipefail
315309
316310
PY_VERSION="${{ matrix.python-version }}"
317311
VERSION_TAG="${PY_VERSION//./}"
318312
319313
echo "Python version: $PY_VERSION"
320-
echo "Platform: ${{ runner.os }}"
321-
echo "Looking for wheel file with pattern: *-cp${VERSION_TAG}-${PLATFORM_TAG}.whl"
322-
314+
echo "Runner arch: ${{ runner.arch }}"
323315
ls -R dist/
324316
325-
# Install the correct wheel using the platform-specific tag
326-
pip install --force-reinstall dist/*-cp${VERSION_TAG}-${PLATFORM_TAG}.whl
327-
328-
# Run the tests
317+
# Decide libc (glibc vs musl)
318+
if [ -f /etc/alpine-release ]; then
319+
echo "Detected musl (Alpine) -> selecting musllinux wheel"
320+
WHEEL="$(ls dist/*-cp${VERSION_TAG}-cp${VERSION_TAG}-musllinux_*.whl | head -n 1 || true)"
321+
else
322+
echo "Detected glibc -> selecting manylinux wheel"
323+
WHEEL="$(ls dist/*-cp${VERSION_TAG}-cp${VERSION_TAG}-manylinux_*.whl | head -n 1 || true)"
324+
fi
325+
326+
if [ -z "${WHEEL}" ]; then
327+
echo "No compatible wheel found for cp${VERSION_TAG} on this runner."
328+
echo "Available wheels:"
329+
ls -1 dist/
330+
exit 1
331+
fi
332+
333+
echo "Installing wheel: ${WHEEL}"
334+
pip install --force-reinstall "${WHEEL}"
335+
329336
pytest tests/
330-
shell: bash
337+
338+
# - name: Install wheel and run tests
339+
# run: |
340+
# # Set the platform-specific wheel tag based on the runner's OS
341+
# if [[ "${{ runner.os }}" == "Linux" ]]; then
342+
# PLATFORM_TAG="*manylinux*"
343+
# elif [[ "${{ runner.os }}" == "Windows" ]]; then
344+
# PLATFORM_TAG="*win_amd64*"
345+
# elif [[ "${{ runner.os }}" == "macOS" ]]; then
346+
# PLATFORM_TAG="*macosx*"
347+
# fi
348+
349+
# PY_VERSION="${{ matrix.python-version }}"
350+
# VERSION_TAG="${PY_VERSION//./}"
351+
352+
# echo "Python version: $PY_VERSION"
353+
# echo "Platform: ${{ runner.os }}"
354+
# echo "Looking for wheel file with pattern: *-cp${VERSION_TAG}-${PLATFORM_TAG}.whl"
355+
356+
# ls -R dist/
357+
358+
# # Install the correct wheel using the platform-specific tag
359+
# pip install --force-reinstall dist/*-cp${VERSION_TAG}-${PLATFORM_TAG}.whl
360+
361+
# # Run the tests
362+
# pytest tests/
363+
# shell: bash
331364

332365
publish_to_pypi:
333366
name: Publish wheels to PyPI

0 commit comments

Comments
 (0)