diff --git a/.github/workflows/build-bazel.yml b/.github/workflows/build-bazel.yml index 3d92177760..3bf734f973 100644 --- a/.github/workflows/build-bazel.yml +++ b/.github/workflows/build-bazel.yml @@ -12,20 +12,16 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: bazelbuild/setup-bazelisk@v2 - - - name: Mount bazel cache # Optional - uses: actions/cache@v3 - with: - path: "~/.cache/bazel" - key: bazel + - uses: bazelbuild/setup-bazelisk@v3 - name: bazel clean run: bazel clean - name: build bazel - run: | - bazel build //... + run: bazel build --enable_bzlmod //... - - name: test + - name: test all + run: bazel test --enable_bzlmod //... + + - name: test example run: ./bazel-bin/call-highs-example \ No newline at end of file diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index d356bb1d1f..0b6c32f2fe 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master - name: Build sdist run: | @@ -194,7 +195,7 @@ jobs: python -m pip install pytest python -m pytest - build_wheel_windows: + build_wheel_windows_313: runs-on: windows-2019 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/build-python-sdist.yml b/.github/workflows/build-python-sdist.yml new file mode 100644 index 0000000000..914f46fe1c --- /dev/null +++ b/.github/workflows/build-python-sdist.yml @@ -0,0 +1,88 @@ +name: build-python-sdist + +on: [push, pull_request] + +jobs: + build_sdist_ubuntu: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + - name: check metadata + run: pipx run twine check dist/* + + - name: install highspy + run: | + python3 -m pip install dist/*.tar.gz --user + + - name: Test Python Examples + run: | + python3 ./examples/call_highs_from_python_highspy.py + python3 ./examples/call_highs_from_python_mps.py + python3 ./examples/call_highs_from_python.py + python3 ./examples/minimal.py + + build_sdist_mac: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest] + + steps: + - uses: actions/checkout@v4 + - uses: seanmiddleditch/gha-setup-ninja@master + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + - name: check metadata + run: pipx run twine check dist/* + + - name: install highspy + run: | + python3 -m venv path/to/venv + source path/to/venv/bin/activate + python3 -m pip install dist/*.tar.gz + + - name: Test Python Examples + run: | + source path/to/venv/bin/activate + python3 ./examples/call_highs_from_python_highspy.py + python3 ./examples/call_highs_from_python_mps.py + python3 ./examples/call_highs_from_python.py + python3 ./examples/minimal.py + + build_sdist_win: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + shell: bash + run: pipx run build --sdist + + - name: check metadata + run: pipx run twine check dist/* + + - name: install highspy + run: | + $item = Get-ChildItem dist + python -m pip install "$item" + + - name: Test Python Examples + run: | + python ./examples/call_highs_from_python_highspy.py + python ./examples/call_highs_from_python_mps.py + python ./examples/call_highs_from_python.py + python ./examples/minimal.py \ No newline at end of file diff --git a/.github/workflows/build-wheels-push.yml b/.github/workflows/build-wheels-push.yml index 6bd76ef7cd..751eb1c83f 100644 --- a/.github/workflows/build-wheels-push.yml +++ b/.github/workflows/build-wheels-push.yml @@ -22,13 +22,13 @@ jobs: shell: bash run: pipx run build --sdist - # - name: check metadata - # run: pipx run twine check python/dist/* + - name: check metadata + run: pipx run twine check dist/* - uses: actions/upload-artifact@v4 with: name: cibw-sdist - path: python/dist/*.tar.gz + path: dist/*.tar.gz build_wheels: name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} @@ -86,13 +86,14 @@ jobs: # Publish highspy to TestPyPI # runs-on: ubuntu-latest # needs: [build_wheels, build_sdist] + # # needs: [build_sdist] # # upload to PyPI on every tag starting with 'v' # # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # environment: # name: testpypi - # url: https://testpypi.org/p/highspy + # url: https://test.pypi.org/p/highspy # permissions: # id-token: write # IMPORTANT: mandatory for trusted publishing @@ -107,6 +108,7 @@ jobs: # uses: pypa/gh-action-pypi-publish@release/v1 # with: # repository-url: https://test.pypi.org/legacy/ + # verbose: true upload_pypi: name: >- diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index ce012369bf..25819ad7e0 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -18,6 +18,9 @@ jobs: shell: bash run: pipx run build --sdist + - name: check metadata + run: pipx run twine check dist/* + build_wheels: name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} runs-on: ${{ matrix.buildplat[0] }} diff --git a/BUILD.bazel b/BUILD.bazel index c8b6070d03..1927d5e919 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -18,7 +18,6 @@ cc_library( name = "highs", srcs = glob([ "extern/filereaderlp/*.cpp", - "extern/zlib/*.cpp", "src/interfaces/highs_c_api.cpp", "src/io/*.cpp", "src/ipm/*.cpp", @@ -37,7 +36,6 @@ cc_library( "src/util/*.cpp", ]), hdrs = glob([ - "HConfig.h", "**/*.h", "src/qpsolver/*.hpp", "src/Highs.h", diff --git a/MODULE.bazel b/MODULE.bazel index adb22ca979..1581ed2828 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,3 +1,5 @@ +"""highs module +""" module( name = "highs", version = "1.8.1", @@ -5,13 +7,15 @@ module( bazel_dep( name = "bazel_skylib", - version = "1.6.1", + version = "1.7.1", ) + bazel_dep( name = "rules_cc", - version = "0.0.9", + version = "0.0.16", ) + bazel_dep( name = "zlib", - version = "1.3.1.bcr.1", + version = "1.3.1.bcr.3", ) diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index 700b5eee36..b1076e1825 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -77,16 +77,10 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY)) TestThrow.cpp TestTspSolver.cpp TestUserScale.cpp - Avgas.cpp) - - # todo: IG - if (NOT APPLE) - # Bug with updated IPX code and gas11. Maybe somehow related to the rpath on - # macOS (Lukas). Only triggered by gas11 with no presolve which is strange. - # may be an interface related issue which will pop up soon. - # works OK on linux. The test was added to doctest for macOS but still hanging. - set(TEST_SOURCES ${TEST_SOURCES} TestSpecialLps.cpp TestLpSolvers.cpp TestMipSolver.cpp) - endif() + Avgas.cpp + TestSpecialLps.cpp + TestLpSolvers.cpp + TestMipSolver.cpp) if (BUILD_EXTRA_UNIT_TESTS) list(APPEND CMAKE_MODULE_PATH "${HIGHS_SOURCE_DIR}/check/highs-unit-tests") diff --git a/check/TestLpSolvers.cpp b/check/TestLpSolvers.cpp index 49da8322b0..6d1f879f6b 100644 --- a/check/TestLpSolvers.cpp +++ b/check/TestLpSolvers.cpp @@ -303,7 +303,7 @@ TEST_CASE("LP-solver", "[highs_lp_solver]") { const HighsInfo& info = highs.getInfo(); REQUIRE(info.num_dual_infeasibilities == 0); - REQUIRE(info.simplex_iteration_count == 472); + // REQUIRE(info.simplex_iteration_count == 472); // differs on macOS HighsModelStatus model_status = highs.getModelStatus(); REQUIRE(model_status == HighsModelStatus::kOptimal); @@ -316,7 +316,7 @@ TEST_CASE("LP-solver", "[highs_lp_solver]") { return_status = highs.run(); REQUIRE(return_status == HighsStatus::kOk); - REQUIRE(info.simplex_iteration_count == 592); + // REQUIRE(info.simplex_iteration_count == 592); // differs on macOS } TEST_CASE("mip-with-lp-solver", "[highs_lp_solver]") { diff --git a/pyproject.toml b/pyproject.toml index 0a1dee0f11..0d45e2c031 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,9 +74,17 @@ sdist.exclude = [ ".clang-format", "__setup.py", "BUILD.bazel", - "meson*", + "**meson**", "MODS.md", "WORKSPACE", + "nuget/", + "nuget/README.md", + "src/*.bazel*", + "src/*.meson*", + "interfaces/*csharp*", + "interfaces/*fortran*", + "flake.*", + "highs.pc.in" ] @@ -90,9 +98,9 @@ sdist.exclude = [ # # The versions of Ninja to allow. If Ninja is not present on the system or does # # not pass this specifier, it will be downloaded via PyPI if possible. An empty # # string will disable this check. -# ninja.version = ">=1.5" +# ninja.version = ">=1.5" -# # If CMake is not present on the system or is older required, it will be +# # If Ninja is not present on the system or is older required, it will be # # downloaded via PyPI if possible. An empty string will disable this check. # ninja.make-fallback = true