Skip to content

Commit

Permalink
[ci] Use locally built wheels
Browse files Browse the repository at this point in the history
Python was not picking up the locally built wheels and instead using the
version published on pypi. Make sure pip installs the local wheel. This
uncovered another issue where we were testing on platform combinations that are
not supported on Github CI (namely Ubuntu / musllinux and Windows 2019 / win32).
  • Loading branch information
olafmersmann committed Nov 28, 2024
1 parent 0cd5478 commit 29244ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 32 deletions.
45 changes: 13 additions & 32 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,21 @@ jobs:
- [ubuntu-20.04, manylinux_x86_64]
- [ubuntu-20.04, musllinux_x86_64]
- [macos-14, macosx_arm64]
- [windows-2019, win_amd64]
- [windows-2019, win32]
- [windows-2019, win_amd64]
python:
- ["cp39", "3.9"]
- ["cp310", "3.10"]
- ["cp311", "3.11"]
- ["cp312", "3.12"]
- ["pp39", "pp"]
exclude:
# Don't build PyPy 32-bit windows
- buildplat: [windows-2019, win32]
python: ["pp39", "pp"]
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ]
python: ["pp39", "pp"]
runs-on: ${{ matrix.buildplat[0] }}
defaults:
run:
working-directory: ${{github.workspace}}
steps:
- name: Setup MSVC (32-bit)
if: ${{ matrix.buildplat[1] == 'win32' }}
uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1
with:
architecture: 'x86'
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -77,18 +68,10 @@ jobs:
fail-fast: false
matrix:
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [ubuntu-20.04, musllinux_x86_64]
- [ubuntu-20.04, manylinux_x86_64]
- [macos-14, macosx_arm64]
- [windows-2019, win_amd64]
- [windows-2019, win32]
python: ["3.9", "3.10", "3.11", "3.12"]
exclude:
# Don't build PyPy 32-bit windows
- buildplat: [windows-2019, win32]
python: "3.9"
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ]
python: "3.9"
runs-on: ${{ matrix.buildplat[0] }}
defaults:
run:
Expand All @@ -102,13 +85,16 @@ jobs:
with:
name: dist-python-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }}
path: wheels
- name: List available wheels
run: ls -l wheels/
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}
- name: Setup Python
run: python -m pip install --upgrade pip wheel
- name: Install cocoex
run: python -m pip install --find-links wheels/ coco-experiment
shell: bash
run: python -m pip install wheels/coco_experiment*.whl
- name: Run cocoex test
shell: bash
run: |
Expand All @@ -123,18 +109,10 @@ jobs:
fail-fast: false
matrix:
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [ubuntu-20.04, musllinux_x86_64]
- [ubuntu-20.04, manylinux_x86_64]
- [macos-14, macosx_arm64]
- [windows-2019, win_amd64]
- [windows-2019, win32]
- [windows-2019, win_amd64]
python: ["3.9", "3.10", "3.11", "3.12"]
exclude:
# Don't build PyPy 32-bit windows
- buildplat: [windows-2019, win32]
python: "3.9"
- buildplat: [ ubuntu-20.04, musllinux_x86_64 ]
python: "3.9"
runs-on: ${{ matrix.buildplat[0] }}
defaults:
run:
Expand All @@ -151,7 +129,10 @@ jobs:
- name: Setup Python
run: python -m pip install --upgrade pip wheel
- name: Install cocoex and cocopp
run: python -m pip install --find-links wheels/ coco-experiment cocopp
shell: bash
run: |
python -m pip install wheels/coco_experiment*.whl
python -m pip install cocopp
- name: Install scipy for example experiment
run: python -m pip install scipy
- name: Run example experiment
Expand Down
1 change: 1 addition & 0 deletions build/python/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
from setuptools import Extension, setup


extensions = []
extensions.append(Extension(name="cocoex.interface",
sources=["src/cocoex/coco.c", "src/cocoex/interface.pyx"],
Expand Down

0 comments on commit 29244ab

Please sign in to comment.