diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 343fb97540..377f74d363 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -157,9 +157,16 @@ jobs: name: cibw-wheels-${{ matrix.python }}-${{ matrix.manylinux }} path: | ./wheelhouse/*.whl + + - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + with: + name: stubs-${{ matrix.python }}-${{ matrix.manylinux }} + path: | ./wheelhouse/OpenImageIO/__init__.pyi - # if stub validation fails we want to upload the stubs for users to review - if: success() || failure() + # if stub validation fails we want to upload the stubs for users to review. + # keep the python build in sync with the version specified in tool.cibuildwheel.overrides + # section of pyproject.toml + if: always() && contains(matrix.python, 'cp311-manylinux') # --------------------------------------------------------------------------- # Linux ARM Wheels @@ -219,65 +226,78 @@ jobs: name: cibw-wheels-${{ matrix.python }}-${{ matrix.manylinux }} path: | ./wheelhouse/*.whl + + - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + with: + name: stubs-${{ matrix.python }}-${{ matrix.manylinux }} + path: | ./wheelhouse/OpenImageIO/__init__.pyi - # if stub validation fails we want to upload the stubs for users to review - if: success() || failure() + # if stub validation fails we want to upload the stubs for users to review. + # keep the python build in sync with the version specified in tool.cibuildwheel.overrides + # section of pyproject.toml + if: always() && contains(matrix.python, 'cp311-manylinux') # --------------------------------------------------------------------------- # macOS Wheels # --------------------------------------------------------------------------- - # macos: - # name: Build wheels on macOS - # runs-on: macos-13 - # if: | - # github.event_name != 'schedule' || - # github.repository == 'AcademySoftwareFoundation/OpenImageIO' - # strategy: - # matrix: - # include: - # # ------------------------------------------------------------------- - # # CPython 64 bits - # # ------------------------------------------------------------------- - # - build: CPython 3.9 64 bits - # python: cp39-macosx_x86_64 - # arch: x86_64 - # - build: CPython 3.10 64 bits - # python: cp310-macosx_x86_64 - # arch: x86_64 - # - build: CPython 3.11 64 bits - # python: cp311-macosx_x86_64 - # arch: x86_64 - # - build: CPython 3.12 64 bits - # python: cp312-macosx_x86_64 - # arch: x86_64 - # - build: CPython 3.13 64 bits - # python: cp313-macosx_x86_64 - # arch: x86_64 - - # steps: - # - name: Checkout repo - # uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - # - name: Install Python - # uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - # with: - # python-version: '3.9' - - # - name: Build wheels - # uses: pypa/cibuildwheel@d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23 # v2.21.1 - # env: - # CIBW_BUILD: ${{ matrix.python }} - # CIBW_ARCHS: ${{ matrix.arch }} - # CMAKE_GENERATOR: "Unix Makefiles" - # # TODO: Re-enable HEIF when we provide a build recipe that does - # # not include GPL-licensed dynamic libraries. - # USE_Libheif: 'OFF' - - # - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 - # with: - # name: cibw-wheels-${{ matrix.python }} - # path: ./wheelhouse/*.whl + macos: + name: Build wheels on macOS + runs-on: macos-13 + if: | + github.event_name != 'schedule' || + github.repository == 'AcademySoftwareFoundation/OpenImageIO' + strategy: + matrix: + include: + # ------------------------------------------------------------------- + # CPython 64 bits + # ------------------------------------------------------------------- + - build: CPython 3.9 64 bits + python: cp39-macosx_x86_64 + arch: x86_64 + - build: CPython 3.10 64 bits + python: cp310-macosx_x86_64 + arch: x86_64 + - build: CPython 3.11 64 bits + python: cp311-macosx_x86_64 + arch: x86_64 + - build: CPython 3.12 64 bits + python: cp312-macosx_x86_64 + arch: x86_64 + - build: CPython 3.13 64 bits + python: cp313-macosx_x86_64 + arch: x86_64 + + steps: + - name: Checkout repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Install Python + uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: '3.9' + + - name: Remove brew OpenEXR/Imath + run: | + brew uninstall --ignore-dependencies openexr imath || true + + - name: Build wheels + uses: pypa/cibuildwheel@d4a2945fcc8d13f20a1b99d461b8e844d5fc6e23 # v2.21.1 + env: + CIBW_BUILD: ${{ matrix.python }} + CIBW_ARCHS: ${{ matrix.arch }} + MACOSX_DEPLOYMENT_TARGET: 10.15 + CMAKE_GENERATOR: "Unix Makefiles" + # TODO: Re-enable HEIF when we provide a build recipe that does + # not include GPL-licensed dynamic libraries. + USE_Libheif: 'OFF' + + - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + with: + name: cibw-wheels-${{ matrix.python }} + path: ./wheelhouse/*.whl + # --------------------------------------------------------------------------- # macOS ARM Wheels @@ -317,7 +337,6 @@ jobs: - name: Install Python uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - # https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64 with: python-version: '3.9' @@ -389,7 +408,7 @@ jobs: upload_pypi: - needs: [sdist, linux, linux-arm, macos-arm, windows] + needs: [sdist, linux, linux-arm, macos, macos-arm, windows] runs-on: ubuntu-latest permissions: id-token: write diff --git a/CMakeLists.txt b/CMakeLists.txt index ee4b9d413f..2ed1589cfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,7 +191,9 @@ if (IGNORE_HOMEBREWED_DEPS) # Define the list of prefixes to ignore set (HOMEBREW_PREFIXES /opt/homebrew + /opt/homebrew/Cellar /usr/local + /usr/local/Cellar /usr/X11 /usr/X11R6 /opt/X11 diff --git a/pyproject.toml b/pyproject.toml index e38f7e924e..b243ba3ddc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,12 +88,14 @@ if.platform-system = "darwin" if.platform-machine = "arm64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "arm64" +cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "11" [[tool.scikit-build.overrides]] if.platform-system = "darwin" if.platform-machine = "x86_64" inherit.cmake.define = "append" cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64" +cmake.define.CMAKE_OSX_DEPLOYMENT_TARGET = "10.15" [tool.cibuildwheel] build-verbosity = 1 @@ -109,8 +111,6 @@ test-command = "oiiotool --buildinfo" [tool.cibuildwheel.macos.environment] SKBUILD_CMAKE_ARGS = "-DLINKSTATIC=1; -DIGNORE_HOMEBREWED_DEPS=1" -# C++17 - std::filesystem is only available in macOS 10.15 and later; ARM compatibility introduced in 11. -MACOSX_DEPLOYMENT_TARGET = "11" # Optimize for size (not speed). SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel" diff --git a/src/cmake/build_yaml-cpp.cmake b/src/cmake/build_yaml-cpp.cmake index 05cab6187f..1de3b876a8 100644 --- a/src/cmake/build_yaml-cpp.cmake +++ b/src/cmake/build_yaml-cpp.cmake @@ -25,6 +25,7 @@ build_dependency_with_cmake(yaml-cpp -D YAML_CPP_BUILD_CONTRIB=OFF -D YAML_BUILD_SHARED_LIBS=${yaml-cpp_BUILD_SHARED_LIBS} -D CMAKE_INSTALL_LIBDIR=lib + -D CMAKE_POLICY_VERSION_MINIMUM=3.5 ) set (yaml-cpp_ROOT ${yaml-cpp_LOCAL_INSTALL_DIR})