Skip to content

Commit

Permalink
CI: Rework to have dependencies when building
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed May 5, 2024
1 parent e107b4a commit 1599e75
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ jobs:

- name: Build sdist
run: |
python3 -m pip install build
python3 -m pip install build --user
python3 -m build --sdist
- name: Install sdist
run: |
ls dist
python3 -m pip install meson-python meson pybind11 ninja --user
python3 -m pip install dist/*.tar.gz
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
python3 -m pip install pytest --user
python3 -m pytest $GITHUB_WORKSPACE/tests
build_sdist_mac:
runs-on: macos-latest
Expand All @@ -34,18 +35,19 @@ jobs:

- name: Build sdist
run: |
python3 -m pip install build --break-system-packages
python3 -m pip install build --user --break-system-packages
python3 -m build --sdist
- name: Install sdist
run: |
ls dist
python3 -m pip install dist/*.tar.gz --break-system-packages
python3 -m pip install meson-python meson pybind11 ninja --user --break-system-packages
python3 -m pip install dist/*.tar.gz
- name: Test highspy
run: |
python3 -m pip install pytest --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE
python3 -m pip install pytest --user --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE/tests
build_sdist_win:
runs-on: windows-latest
Expand All @@ -59,18 +61,19 @@ jobs:

- name: Build sdist
run: |
python -m pip install build
python -m pip install build --user
python -m build --sdist
- name: Install sdist
run: |
python3 -m pip install meson-python meson pybind11 ninja --user
$item = Get-ChildItem dist
python -m pip install "$item"
python -m pip install "$item" --user
python -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python -m pip install pytest
python -m pip install pytest --user
python -m pytest
build_wheel_linux:
Expand Down Expand Up @@ -103,7 +106,7 @@ jobs:
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
python3 -m pytest $GITHUB_WORKSPACE/tests
# macos 12 is Intel
Expand All @@ -122,20 +125,20 @@ jobs:

- name: Build wheel
run: |
python3 -m pip install cibuildwheel
python3 -m pip install cibuildwheel --break-system-packages
python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl
python3 -m pip install wheelhouse/*.whl --break-system-packages
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
python3 -m pip install pytest --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE/tests
# macos 13 is Intel
build_wheel_macos_13:
Expand All @@ -153,20 +156,20 @@ jobs:

- name: Build wheel
run: |
python3 -m pip install cibuildwheel
python3 -m pip install cibuildwheel --break-system-packages
python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl
python3 -m pip install wheelhouse/*.whl --break-system-packages
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
python3 -m pip install pytest --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE/tests
# macos 14 is M1 (beta)
build_wheel_macos_14:
Expand All @@ -184,20 +187,20 @@ jobs:

- name: Build wheel
run: |
python3 -m pip install cibuildwheel
python3 -m pip install cibuildwheel --break-system-packages
python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl
python3 -m pip install wheelhouse/*.whl --break-system-packages
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
python3 -m pip install pytest --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE/tests
build_wheel_windows:
runs-on: windows-latest
Expand All @@ -224,5 +227,4 @@ jobs:
- name: Test highspy
run: |
python -m pip install pytest
python -m pytest
python -m pytest
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Bug Tracker" = "https://github.com/ERGO-Code/HiGHS/issues"

[build-system]
requires = ["meson-python<0.14.0", "meson>=1.2.0"]
requires = ["meson-python<0.14.0", "meson>=1.2.0", "pybind11", "ninja"]
build-backend = "mesonpy"

[project]
Expand Down

0 comments on commit 1599e75

Please sign in to comment.