Skip to content

Commit

Permalink
cleanup: Minor adjustments to pyproject.toml
Browse files Browse the repository at this point in the history
- Add support for Python 3.13
- Update minimum required Python version from 3.7 to 3.8
 (Need to further investigate CIBW troubles with python 3.7)
- Upgrade scikit-build-core dependency to >=0.10.6,<1 (up from 0.10)
- Add oldest-supported-numpy as a new build dependency. I don't think numpy is actually needed at build time, but this seems to help certain builds not have to compile numpy from source.
- Skip 32-bit builds in cibuildwheel configuration
- Enable free-threaded support for Python 3.13
- Adjust manylinux and musllinux images versions in cibuildwheel configuration for local testing -- these are currently overridden by environment variables set in the Wheels github workflow.
Specifically, use the manylinux2014 (i.e., CentOS-7) image for python 3.7 and 3.8; and use manylinux_2_28 (Rocky) for the rest.

Signed-off-by: Zach Lewis <[email protected]>
  • Loading branch information
zachlewis committed Sep 17, 2024
1 parent f5e118d commit 16d634e
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: Apache Software License",
"Topic :: Multimedia :: Graphics",
"Topic :: Multimedia :: Video",
"Topic :: Multimedia :: Video :: Display",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = ["numpy"]
requires-python = ">= 3.7"
requires-python = ">= 3.8"

[project.urls]
Homepage = "https://openimageio.org/"
Expand All @@ -52,8 +53,9 @@ testtex = "OpenImageIO:_command_line"
[build-system]
build-backend = "scikit_build_core.build"
requires = [
"scikit-build-core>=0.10,<1",
"scikit-build-core>=0.10.6,<1",
"pybind11",
"oldest-supported-numpy",
]

[tool.scikit-build]
Expand Down Expand Up @@ -95,9 +97,17 @@ if.platform-machine = "x86_64"
inherit.cmake.define = "append"
cmake.define.CMAKE_OSX_ARCHITECTURES = "x86_64"

[[tool.scikit-build.overrides]]
if.platform-system = "linux"
inherit.cmake.define = "append"
cmake.define.CMAKE_CXX_FLAGS = "-Wno-error=stringop-overflow -Wno-pragmas"

[tool.cibuildwheel]
build-verbosity = 1
skip = [
# Skip 32-bit builds
"*-win32",
"*-manylinux_i686",
# Building with musl seems to work, but the repair-wheel step seems to fail...
# This may be a bug in repairwheel (or auditwheel)?
"*musllinux*",
Expand All @@ -107,10 +117,23 @@ skip = [
# CLI binary executables and find and load all shared libraries. The
# '--help' flag outputs a list of dependencies with which OIIO was compiled.
test-command = "oiiotool --help"
# Enable free-threaded support
free-threaded-support = true
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
manylinux-pypy_x86_64-image = "manylinux_2_28"
manylinux-pypy_aarch64-image = "manylinux_2_28"
musllinux-x86_64-image = "musllinux_1_2"
musllinux-aarch64-image = "musllinux_1_2"

# For CIBW-based builds, optimize for size, not speed.
[[tool.cibuildwheel.overrides]]
select = "*"
inherit.environment = "append"
environment.SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel"


[tool.cibuildwheel.macos.environment]
# Optimize for size (not speed)
SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel"
# Specify a build directory so the repairwheel command can (re)find
# dependency libraries built by OpenImageIO.
SKBUILD_BUILD_DIR = "/tmp/build_oiio_wheels"
Expand All @@ -121,21 +144,26 @@ SKBUILD_CMAKE_ARGS = "-DOpenImageIO_BUILD_LOCAL_DEPS=TIFF; -DOpenImageIO_BUILD_M
MACOSX_DEPLOYMENT_TARGET = "10.15"

[tool.cibuildwheel.linux.environment]
SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel"
SKBUILD_BUILD_DIR = "/tmp/build_oiio_wheels"
SKBUILD_CMAKE_ARGS = "-DOpenImageIO_BUILD_LOCAL_DEPS=TIFF; -DOpenImageIO_BUILD_MISSING_DEPS=all"
# Suppress warnings that cause linux cibuildwheel build to fail
CXXFLAGS = "-Wno-error=stringop-overflow= -Wno-pragmas"
CXXFLAGS = "-Wno-error=stringop-overflow -Wno-pragmas"

[tool.cibuildwheel.linux.windows]
SKBUILD_CMAKE_BUILD_TYPE = "MinSizeRel"

# On macOS and Linux, run a custom repair-wheel-command after the build.
# See tasks.py for more details.
[tool.cibuildwheel.macos]
before-build = "pip install repairwheel && pip install invoke"
before-build = "pip install 'repairwheel' && pip install invoke"
repair-wheel-command = "invoke wheel-repair --build-dir ${SKBUILD_BUILD_DIR} --wheel-path {wheel} --output-dir {dest_dir}"

[tool.cibuildwheel.linux]
before-build = "pip install repairwheel && pip install invoke"
repair-wheel-command = "invoke wheel-repair --build-dir ${SKBUILD_BUILD_DIR} --wheel-path {wheel} --output-dir {dest_dir}"


[[tool.cibuildwheel.overrides]]
select = "{c,p}p3{7,8}-*"
manylinux-x86_64-image = "manylinux2014"
manylinux-aarch64-image = "manylinux2014"
manylinux-pypy_x86_64-image = "manylinux2014"
manylinux-pypy-aarch64-image = "manylinux2014"

0 comments on commit 16d634e

Please sign in to comment.