From 05325402a1f30f2ea0e2b9a3e36e4fdd81b788f6 Mon Sep 17 00:00:00 2001 From: Nickolai Belakovski Date: Sun, 16 Jun 2024 14:24:10 -0400 Subject: [PATCH] Trying to fix CI issues - gcc 13.3.0 seems to have an issue with math.h on macOS. It spews a bunch of errors about the API_DEPRECATED macro not being used correctly, which is not an issue on our side. gcc 13.2.0 does not seem to have this issue, but since we cannot select gcc with such granularity we downgrade to gcc 12 and hope this fixes the issue for now. - numpy 2.0.0 has come out which causes runtime issues. Fortunately the fix is easy, just build with pybind11 >=2.12.0. However this is still an issue for the pdfo compatibility test since pdfo does not support numpy 2.0.0, and sometimes the tests install 2.0.0 because it happens to be in the pip cache. So we upgrade pybind11 (the new version is compatible with 2.0 and 1.0 numpy) and skip the pdfo test if we happened to pick up numpy 2. - macOS builds for building Python wheels started to complain when running the "delocate" step that libquadmath, libstdc++, and libgfortran have minimum targets of 11.0, whereas the default was 10.9, hence we added the relevant env variable for CIBW. --- .github/workflows/build_python.yml | 1 + pyproject.toml | 3 +++ python/pybind11 | 2 +- python/tests/test_compatibility_pdfo.py | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml index a0ecce12f9..241548dae3 100644 --- a/.github/workflows/build_python.yml +++ b/.github/workflows/build_python.yml @@ -51,6 +51,7 @@ jobs: if: ${{ runner.os == 'macOS' }} with: compiler: gcc + version: 12 # Copied from https://github.com/scipy/scipy/blob/main/.github/workflows/wheels.yml # For rtools, see https://github.com/r-windows/rtools-installer/releases, which has been diff --git a/pyproject.toml b/pyproject.toml index a8fdeea31b..ddb4c6378b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,3 +52,6 @@ skip = [ # As such we can compile but we cannot test, so we skip those. "cp31*-manylinux_i686", ] + +[tool.cibuildwheel.macos.environment] +MACOSX_DEPLOYMENT_TARGET = "11" \ No newline at end of file diff --git a/python/pybind11 b/python/pybind11 index 8a099e44b3..3e9dfa2866 160000 --- a/python/pybind11 +++ b/python/pybind11 @@ -1 +1 @@ -Subproject commit 8a099e44b3d5f85b20f05828d919d2332a8de841 +Subproject commit 3e9dfa2866941655c56877882565e7577de6fc7b diff --git a/python/tests/test_compatibility_pdfo.py b/python/tests/test_compatibility_pdfo.py index 6eaaaf6cd5..9ecfc90c06 100644 --- a/python/tests/test_compatibility_pdfo.py +++ b/python/tests/test_compatibility_pdfo.py @@ -20,6 +20,9 @@ def test_pdfo(): scipy = pytest.importorskip("scipy") if version.parse(scipy.__version__) < version.parse("1.11.0"): pytest.skip("scipy version too old for this test (its version of COBYLA does not accept bounds)") + numpy = pytest.importorskip("numpy") + if version.parse(numpy.__version__) >= version.parse("2.0.0"): + pytest.skip("numpy version too new for this test (pdfo does not yet support numpy v2)") from pdfo import pdfo from scipy.optimize import NonlinearConstraint as NLC, LinearConstraint as LC, Bounds