Skip to content

Commit

Permalink
Python 3.13 wheels (#2052)
Browse files Browse the repository at this point in the history
* Python 3.13 wheels

Signed-off-by: Rémi Achard <[email protected]>

* Build mac ARM wheels on Apple Silicon runners to enable testing

Signed-off-by: Rémi Achard <[email protected]>

* Fix upload_pypi job dependencies

Signed-off-by: Rémi Achard <[email protected]>

---------

Signed-off-by: Rémi Achard <[email protected]>
  • Loading branch information
remia authored Sep 24, 2024
1 parent 145bce2 commit 77e92a9
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 27 deletions.
87 changes: 62 additions & 25 deletions .github/workflows/wheel_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ jobs:
# -------------------------------------------------------------------
# CPython 64 bits manylinux_2_28
# -------------------------------------------------------------------
- build: CPython 3.7 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp37-manylinux_x86_64
arch: x86_64
- build: CPython 3.8 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp38-manylinux_x86_64
Expand All @@ -105,13 +101,13 @@ jobs:
manylinux: manylinux_2_28
python: cp312-manylinux_x86_64
arch: x86_64
- build: CPython 3.13 64 bits manylinux_2_28
manylinux: manylinux_2_28
python: cp313-manylinux_x86_64
arch: x86_64
# -------------------------------------------------------------------
# CPython 64 bits manylinux2014
# -------------------------------------------------------------------
- build: CPython 3.7 64 bits manylinux2014
manylinux: manylinux2014
python: cp37-manylinux_x86_64
arch: x86_64
- build: CPython 3.8 64 bits manylinux2014
manylinux: manylinux2014
python: cp38-manylinux_x86_64
Expand All @@ -132,13 +128,13 @@ jobs:
manylinux: manylinux2014
python: cp312-manylinux_x86_64
arch: x86_64
- build: CPython 3.13 64 bits manylinux2014
manylinux: manylinux2014
python: cp313-manylinux_x86_64
arch: x86_64
# -------------------------------------------------------------------
# CPython ARM 64 bits manylinux2014
# -------------------------------------------------------------------
- build: CPython 3.7 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp37-manylinux_aarch64
arch: aarch64
- build: CPython 3.8 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp38-manylinux_aarch64
Expand All @@ -159,22 +155,26 @@ jobs:
manylinux: manylinux2014
python: cp312-manylinux_aarch64
arch: aarch64
- build: CPython 3.13 ARM 64 bits manylinux2014
manylinux: manylinux2014
python: cp313-manylinux_aarch64
arch: aarch64

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
python-version: '3.9'

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.1
env:
CIBW_BUILD: ${{ matrix.python }}
CIBW_ARCHS: ${{ matrix.arch }}
Expand Down Expand Up @@ -203,9 +203,6 @@ jobs:
# -------------------------------------------------------------------
# CPython 64 bits
# -------------------------------------------------------------------
- build: CPython 3.7 64 bits
python: cp37-macosx_x86_64
arch: x86_64
- build: CPython 3.8 64 bits
python: cp38-macosx_x86_64
arch: x86_64
Expand All @@ -221,6 +218,43 @@ jobs:
- 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:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.9'

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}
CIBW_ARCHS: ${{ matrix.arch }}

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.python }}
path: ./wheelhouse/*.whl

# ---------------------------------------------------------------------------
# macOS ARM Wheels
# ---------------------------------------------------------------------------

macos-arm:
name: Build wheels on macOS ARM
runs-on: macos-14
# Don't run on OCIO forks
if: |
github.event_name != 'schedule' ||
github.repository == 'AcademySoftwareFoundation/OpenColorIO'
strategy:
matrix:
include:
# -------------------------------------------------------------------
# CPython ARM 64 bits
# -------------------------------------------------------------------
Expand All @@ -239,17 +273,20 @@ jobs:
- build: CPython 3.12 ARM 64 bits
python: cp312-macosx_arm64
arch: arm64
- build: CPython 3.13 ARM 64 bits
python: cp313-macosx_arm64
arch: arm64

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
python-version: '3.9'

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.1
env:
CIBW_BUILD: ${{ matrix.python }}
CIBW_ARCHS: ${{ matrix.arch }}
Expand All @@ -276,9 +313,6 @@ jobs:
# -------------------------------------------------------------------
# CPython 64 bits
# -------------------------------------------------------------------
- build: CPython 3.7 64 bits
python: cp37-win_amd64
arch: AMD64
- build: CPython 3.8 64 bits
python: cp38-win_amd64
arch: AMD64
Expand All @@ -294,17 +328,20 @@ jobs:
- build: CPython 3.12 64 bits
python: cp312-win_amd64
arch: AMD64
- build: CPython 3.13 64 bits
python: cp313-win_amd64
arch: AMD64

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'
python-version: '3.9'

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.21.1
env:
CIBW_BUILD: ${{ matrix.python }}
CIBW_ARCHS: ${{ matrix.arch }}
Expand All @@ -316,7 +353,7 @@ jobs:


upload_pypi:
needs: [sdist, linux, macos, windows]
needs: [sdist, linux, macos, macos-arm, windows]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ test-command = [
before-build = "share/ci/scripts/linux/yum/install_docs_env.sh"

[tool.cibuildwheel.macos]
# cibuildwheel in some cases set this to 10.9 by default, OCIO needs >= 10.13
# macOS ARM wheels needs 11.0, cibuildwheel will automatically bump where appropriate
environment = { MACOSX_DEPLOYMENT_TARGET="10.13" }
before-build = "share/ci/scripts/macos/install_docs_env.sh"

[tool.cibuildwheel.windows]
environment = { PATH="$GITHUB_WORKSPACE/doxygen;$PATH" }
# OCIO_PYTHON_LOAD_DLLS_FROM_PATH can cause segfaults in the current wheel workflow
# Disable for now as wheels are built with static dependencies.
environment = { PATH="$GITHUB_WORKSPACE/doxygen;$PATH", OCIO_PYTHON_LOAD_DLLS_FROM_PATH="0" }
before-build = 'bash -c "share/ci/scripts/windows/install_docs_env.sh $GITHUB_WORKSPACE/doxygen"'
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ classifiers =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
Programming Language :: C++
description = OpenColorIO (OCIO) is a complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation.
Expand Down
2 changes: 1 addition & 1 deletion share/cmake/modules/FindExtPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ if(OCIO_BUILD_PYTHON OR OCIO_BUILD_DOCS)
# pybind11 2.9 fixes issues with MS Visual Studio 2022 (Debug).
ocio_handle_dependency( pybind11 REQUIRED ALLOW_INSTALL
MIN_VERSION 2.9.2
RECOMMENDED_VERSION 2.11.1)
RECOMMENDED_VERSION 2.12.1)
endif()
endif()

Expand Down

0 comments on commit 77e92a9

Please sign in to comment.