Skip to content

Commit

Permalink
Merge pull request #69 from HaoZeke/scipy_highs_tk3
Browse files Browse the repository at this point in the history
ENH: Update to match latest HiGHS
  • Loading branch information
rgommers authored Nov 13, 2024
2 parents 22213df + b8431c5 commit f5f4287
Show file tree
Hide file tree
Showing 193 changed files with 32,532 additions and 19,321 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ concurrency:
cancel-in-progress: true

jobs:
# macos 12 is Intel
build_macos_12:
runs-on: macos-12
# macos 13 is Intel
build_macos_13:
runs-on: macos-13
# strategy:
# matrix:
# python: [3.11]
Expand All @@ -32,7 +32,7 @@ jobs:
name: macos-x64
path: ${{runner.workspace}}/build/dotnet/Highs.Native/runtimes

# macos 14 is M1 (beta)
# macos 14 is M1
build_macos_14:
runs-on: macos-14
steps:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:

build_windows:
runs-on: windows-latest
needs: [build_macos_12, build_macos_14, build_windows_32, build_linux, build_linux_arm64]
needs: [build_macos_13, build_macos_14, build_windows_32, build_linux, build_linux_arm64]
steps:
- uses: actions/checkout@v4
- name: Build HiGHS Windows native
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- uses: actions/upload-artifact@v4
with:
Expand Down
102 changes: 47 additions & 55 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,38 @@ jobs:

- name: Build sdist
run: |
python3 -m pip install build --user
python3 -m pip install build
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 --user
python3 -m pytest $GITHUB_WORKSPACE/tests
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
build_sdist_mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

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

- name: Build sdist
run: |
python -m pip install build --user
python -m pip install build
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" --user
python -m pip install "$item"
python -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python -m pip install pytest --user
python -m pytest tests
python -m pip install pytest
python -m pytest
build_wheel_linux:
# ubuntu 22 has a latest version of cmake, but setup-python
# ubuntu 22 has a latest version of cmake, but setup-python
# does not seem to provide all necessary modules to find python
# from cmake. works on my machine, test the wheels manually
runs-on: ubuntu-latest
Expand Down Expand Up @@ -106,12 +103,11 @@ jobs:
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE/tests
# macos 12 is Intel
build_wheel_macos_12:
runs-on: macos-12
python3 -m pytest $GITHUB_WORKSPACE
# macos 13 is Intel
build_wheel_macos_13:
runs-on: macos-13
strategy:
matrix:
python: [3.11]
Expand All @@ -125,27 +121,27 @@ jobs:

- name: Build wheel
run: |
python3 -m pip install cibuildwheel --break-system-packages
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl --break-system-packages
python3 -m pip install wheelhouse/*.whl
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE/tests
# macos 13 is Intel
build_wheel_macos_13:
runs-on: macos-13
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
# macos 14 is M1
build_wheel_macos_14:
runs-on: macos-14
strategy:
matrix:
python: [3.11]
python: [3.11]
steps:
- uses: actions/checkout@v4

Expand All @@ -156,51 +152,47 @@ jobs:

- name: Build wheel
run: |
python3 -m pip install cibuildwheel --break-system-packages
python3 -m cibuildwheel --only cp311-macosx_x86_64 $GITHUB_WORKSPACE
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl --break-system-packages
python3 -m pip install wheelhouse/*.whl
python3 -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE/tests
# macos 14 is M1 (beta)
build_wheel_macos_14:
runs-on: macos-14
strategy:
matrix:
python: [3.11]
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
build_wheel_windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4

- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
python-version: 3.9

- name: Build wheel
run: |
python3 -m pip install cibuildwheel --break-system-packages
python3 -m cibuildwheel --only cp311-macosx_arm64 $GITHUB_WORKSPACE
python -m pip install cibuildwheel
python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 --version
python3 -m pip install wheelhouse/*.whl --break-system-packages
python3 -c "import highspy; print(dir(highspy))"
$item = Get-ChildItem wheelhouse
python -m pip install "$item"
python -c "import highspy; print(dir(highspy))"
- name: Test highspy
run: |
python3 -m pip install pytest --break-system-packages
python3 -m pytest $GITHUB_WORKSPACE/tests
python -m pip install pytest
python -m pytest
build_wheel_windows:
runs-on: windows-2019
Expand All @@ -210,12 +202,12 @@ jobs:
- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.13

- name: Build wheel
run: |
python -m pip install cibuildwheel
python -m cibuildwheel --only cp39-win_amd64 $GITHUB_WORKSPACE
python -m cibuildwheel --only cp313-win_amd64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
Expand All @@ -227,4 +219,4 @@ jobs:
- name: Test highspy
run: |
python -m pip install pytest
python -m pytest tests
python -m pytest
63 changes: 35 additions & 28 deletions .github/workflows/build-wheels-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ concurrency:
cancel-in-progress: true

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
shell: bash
run: pipx run build --sdist

# - name: check metadata
# run: pipx run twine check python/dist/*

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: python/dist/*.tar.gz

build_wheels:
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
Expand All @@ -30,47 +48,38 @@ jobs:
- [ubuntu-20.04, musllinux_x86_64] # No OpenBlas, no test
- [ubuntu-20.04, musllinux_i686]
- [ubuntu-20.04, musllinux_aarch64]
- [macos-12, macosx_x86_64]
- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
- [windows-2019, win_amd64]
- [windows-2019, win32]
python: ["cp38", "cp39","cp310", "cp311","cp312"]
python: ["cp38", "cp39","cp310", "cp311","cp312", "cp313"]

steps:
- uses: actions/checkout@v4

- name: Set up QEMU # Required for aarch64 builds
if: ${{ contains(matrix.buildplat[1], 'aarch64') }}
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels (aarch64)
if: ${{ contains(matrix.buildplat[1], 'aarch64') }}
uses: pypa/cibuildwheel@v2.19
uses: pypa/cibuildwheel@v2.21
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ARCHS_LINUX: aarch64

- name: Build wheels (not aarch64)
if: ${{ !contains(matrix.buildplat[1], 'aarch64') }}
uses: pypa/cibuildwheel@v2.19
uses: pypa/cibuildwheel@v2.21
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
shell: bash -l {0}
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: cibw-wheels-${{ matrix.python }}-${{ matrix.buildplat[1] }}
path: wheelhouse/*.whl

# upload_testpypi:
# name: >-
Expand All @@ -88,12 +97,11 @@ jobs:
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
# steps:
# - uses: actions/download-artifact@v3
# - uses: actions/download-artifact@v4
# with:
# # unpacks default artifact into dist/
# # if `name: artifact` is omitted, the action will create extra parent dir
# name: artifact
# pattern: cibw-*
# path: dist
# merge-multiple: true

# - name: Download all
# uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -107,7 +115,7 @@ jobs:
needs: [build_wheels, build_sdist]

# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

environment:
name: pypi
Expand All @@ -117,12 +125,11 @@ jobs:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
pattern: cibw-*
path: dist
merge-multiple: true

- name: Download all
uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit f5f4287

Please sign in to comment.