From d6341fc8c602a28a3ee331b7e493741e96e5e7c4 Mon Sep 17 00:00:00 2001 From: Roger Nelson Date: Thu, 18 Dec 2025 13:25:06 -0500 Subject: [PATCH 1/7] Pin python dependencies Signed-off-by: Roger Nelson --- src/build/requirements.txt.in | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/build/requirements.txt.in b/src/build/requirements.txt.in index 16c09f0f6..d2236251e 100644 --- a/src/build/requirements.txt.in +++ b/src/build/requirements.txt.in @@ -6,27 +6,26 @@ # Pure Python packages and build tools safe to install from wheels are listed in RV_PYTHON_WHEEL_SAFE in python3.cmake. # This approach ensures safety by default: new packages will be built from source unless explicitly marked as wheel-safe. -pip # License: MIT License (MIT) -setuptools # License: MIT License -wheel # License: MIT License (MIT) +pip==24.0 # License: MIT License (MIT) +setuptools==69.5.1 # License: MIT License +wheel==0.43.0 # License: MIT License (MIT) numpy==@_numpy_version@ # License: BSD License (BSD-3-Clause) - Required by PySide6 opentimelineio==@_opentimelineio_version@ # License: Other/Proprietary License (Modified Apache 2.0 License) -PyOpenGL # License: BSD License (BSD) +PyOpenGL==3.1.7 # License: BSD License (BSD) # MacOS only - PyOpenGL_accelerate is built from source in python3.cmake as a workaround until the fix # is merged in the main branch. # See https://github.com/mcfletch/pyopengl/issues/147 and https://github.com/mcfletch/pyopengl/pull/146 -# PyOpenGL_accelerate as issue with native arm64 build on MacOS. +# PyOpenGL_accelerate has issue with native arm64 build on MacOS. # Use PyOpenGL_accelerate only on x86_64 platform. -PyOpenGL_accelerate ; (platform_system=='Windows' or platform_system=='Linux') and platform_machine=='x86_64' # License: BSD License (BSD) +PyOpenGL_accelerate==3.1.7 ; (platform_system=='Windows' or platform_system=='Linux') and platform_machine=='x86_64' # License: BSD License (BSD) # Additional packages required by RV and for testing the Python distribution -certifi # License: Mozilla Public License 2.0 (MPL 2.0) (MPL-2.0) - required by test_python.py -six # License: MIT License (MIT) -packaging # License: Apache Software License, BSD License -requests # License: Apache Software License (Apache 2.0) -cryptography # License: Apache Software License, BSD License ((Apache-2.0 OR BSD-3-Clause) AND PSF-2.0) -pydantic # License: MIT License (MIT) - +certifi==2024.2.2 # License: Mozilla Public License 2.0 (MPL 2.0) (MPL-2.0) +six==1.16.0 # License: MIT License (MIT) +packaging==24.0 # License: Apache Software License, BSD License +requests==2.31.0 # License: Apache Software License (Apache 2.0) +cryptography==42.0.5 # License: Apache Software License, BSD License ((Apache-2.0 OR BSD-3-Clause) AND PSF-2.0) +pydantic==2.7.1 # License: MIT License (MIT) From 8035009d68ec02f530d7f5f39896f8fcddc0464a Mon Sep 17 00:00:00 2001 From: Roger Nelson Date: Fri, 19 Dec 2025 09:59:56 -0500 Subject: [PATCH 2/7] Install Linux python build dependencies in CICD Signed-off-by: Roger Nelson --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a4b3d65c..0a75cf9b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -353,6 +353,21 @@ jobs: run: | python3 -m pip install --user --upgrade -r requirements.txt + - name: Install Cython for building PyOpenGL_accelerate + run: | + python3 -m pip install --user Cython + + - name: Install Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Verify Rust installation + run: | + source $HOME/.cargo/env + rustc --version + cargo --version + # For Rocky Linux, we can't cache the dependencies of Open RV # because there is not enough room in the cache (10GB limit) for all platforms. From de6e5799e44ee3d76f398fa1d3b3a33cfb42d646 Mon Sep 17 00:00:00 2001 From: Roger Nelson Date: Thu, 8 Jan 2026 12:01:19 -0500 Subject: [PATCH 3/7] Install py build dependencies before other packages Signed-off-by: Roger Nelson --- .github/workflows/ci.yml | 4 --- cmake/dependencies/python3.cmake | 52 +++++++++++++++++++++++++++----- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a75cf9b9..57625f83c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -353,10 +353,6 @@ jobs: run: | python3 -m pip install --user --upgrade -r requirements.txt - - name: Install Cython for building PyOpenGL_accelerate - run: | - python3 -m pip install --user Cython - - name: Install Rust toolchain run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y diff --git a/cmake/dependencies/python3.cmake b/cmake/dependencies/python3.cmake index a0a5031d5..50c27b7cf 100644 --- a/cmake/dependencies/python3.cmake +++ b/cmake/dependencies/python3.cmake @@ -275,16 +275,24 @@ ELSE() ) ENDIF() -# List of packages that are safe to install from pre-built wheels. All other packages (those with C/C++/Rust extensions) will be built from source to ensure -# proper linking against our custom Python build. Packages are built from source unless explicitly listed here. This includes: pure Python packages, build tools -# that don't need ABI compatibility, and packages with data files only. -SET(RV_PYTHON_WHEEL_SAFE +# Build dependencies that must be installed FIRST before building other packages. +# These are installed from wheels in a separate pip command to ensure they're available +# when packages like PyOpenGL_accelerate need Cython to compile .pyx files. +SET(RV_PYTHON_BUILD_DEPS "pip" # Package installer (pure Python) "setuptools" # Build system (pure Python) "wheel" # Wheel format support (pure Python) - "Cython" # Build tool (compiles Python to C, but the tool itself can use pre-built wheels) + "Cython" # Build tool - MUST be installed before packages with .pyx files "meson-python" # Build backend (pure Python) "ninja" # Build tool (native but doesn't link to Python) + CACHE STRING "Build dependencies to install first (from wheels)" +) + +# List of packages that are safe to install from pre-built wheels. All other packages (those with C/C++/Rust extensions) will be built from source to ensure +# proper linking against our custom Python build. Packages are built from source unless explicitly listed here. This includes: pure Python packages, build tools +# that don't need ABI compatibility, and packages with data files only. +SET(RV_PYTHON_WHEEL_SAFE + ${RV_PYTHON_BUILD_DEPS} # Include build deps in wheel-safe list "PyOpenGL" # OpenGL bindings without acceleration (pure Python) "certifi" # SSL certificate bundle (just data files) "six" # Python 2/3 compatibility (pure Python) @@ -293,9 +301,25 @@ SET(RV_PYTHON_WHEEL_SAFE CACHE STRING "Packages safe to install from wheels (pure Python or build tools)" ) -# Convert list to comma-separated string for pip's --only-binary flag +# Convert lists to space/comma-separated strings for pip commands +STRING(REPLACE ";" " " _build_deps_packages "${RV_PYTHON_BUILD_DEPS}") STRING(REPLACE ";" "," _wheel_safe_packages "${RV_PYTHON_WHEEL_SAFE}") +# Phase 1: Install build dependencies for phase 2. +SET(_build_deps_install_command + "${_python3_executable}" + -s + -E + -I + -m + pip + install + --upgrade + --no-cache-dir + ${_build_deps_packages} +) + +# Phase 2: Install main requirements (with build-from-source for native extensions) SET(_requirements_install_command ${CMAKE_COMMAND} -E env ${_otio_debug_env} ) @@ -412,6 +436,20 @@ IF(APPLE ENDIF() # ############################################################################################################################################################## +# Phase 1 flag: Build dependencies (Cython, etc.) +SET(${_python3_target}-build-deps-flag + ${_install_dir}/${_python3_target}-build-deps-flag +) + +ADD_CUSTOM_COMMAND( + COMMENT "Installing Python build dependencies (pip, setuptools, wheel, Cython, etc.)" + OUTPUT ${${_python3_target}-build-deps-flag} + COMMAND ${_build_deps_install_command} + COMMAND cmake -E touch ${${_python3_target}-build-deps-flag} + DEPENDS ${_python3_target} +) + +# Phase 2 flag: Main requirements (depends on build deps being installed first) SET(${_python3_target}-requirements-flag ${_install_dir}/${_python3_target}-requirements-flag ) @@ -421,7 +459,7 @@ ADD_CUSTOM_COMMAND( OUTPUT ${${_python3_target}-requirements-flag} COMMAND ${_requirements_install_command} COMMAND cmake -E touch ${${_python3_target}-requirements-flag} - DEPENDS ${_python3_target} ${_requirements_output_file} ${_requirements_input_file} + DEPENDS ${_python3_target} ${${_python3_target}-build-deps-flag} ${_requirements_output_file} ${_requirements_input_file} ) # Test the Python distribution after requirements are installed From c0759fb333bf6ee105bd94e74ef984a9d3631cce Mon Sep 17 00:00:00 2001 From: Roger Nelson Date: Thu, 8 Jan 2026 12:07:47 -0500 Subject: [PATCH 4/7] Run pre-commit hook Signed-off-by: Roger Nelson --- cmake/dependencies/python3.cmake | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/cmake/dependencies/python3.cmake b/cmake/dependencies/python3.cmake index 50c27b7cf..39ab92e2c 100644 --- a/cmake/dependencies/python3.cmake +++ b/cmake/dependencies/python3.cmake @@ -275,9 +275,8 @@ ELSE() ) ENDIF() -# Build dependencies that must be installed FIRST before building other packages. -# These are installed from wheels in a separate pip command to ensure they're available -# when packages like PyOpenGL_accelerate need Cython to compile .pyx files. +# Build dependencies that must be installed FIRST before building other packages. These are installed from wheels in a separate pip command to ensure they're +# available when packages like PyOpenGL_accelerate need Cython to compile .pyx files. SET(RV_PYTHON_BUILD_DEPS "pip" # Package installer (pure Python) "setuptools" # Build system (pure Python) @@ -307,16 +306,7 @@ STRING(REPLACE ";" "," _wheel_safe_packages "${RV_PYTHON_WHEEL_SAFE}") # Phase 1: Install build dependencies for phase 2. SET(_build_deps_install_command - "${_python3_executable}" - -s - -E - -I - -m - pip - install - --upgrade - --no-cache-dir - ${_build_deps_packages} + "${_python3_executable}" -s -E -I -m pip install --upgrade --no-cache-dir ${_build_deps_packages} ) # Phase 2: Install main requirements (with build-from-source for native extensions) From 68df727785cd1fe43f7e8176030ea15132453ed0 Mon Sep 17 00:00:00 2001 From: Roger Nelson Date: Thu, 8 Jan 2026 13:29:44 -0500 Subject: [PATCH 5/7] Fix quoted argument Signed-off-by: Roger Nelson --- cmake/dependencies/python3.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/dependencies/python3.cmake b/cmake/dependencies/python3.cmake index 39ab92e2c..9c7bc8cd0 100644 --- a/cmake/dependencies/python3.cmake +++ b/cmake/dependencies/python3.cmake @@ -301,12 +301,11 @@ SET(RV_PYTHON_WHEEL_SAFE ) # Convert lists to space/comma-separated strings for pip commands -STRING(REPLACE ";" " " _build_deps_packages "${RV_PYTHON_BUILD_DEPS}") STRING(REPLACE ";" "," _wheel_safe_packages "${RV_PYTHON_WHEEL_SAFE}") -# Phase 1: Install build dependencies for phase 2. +# Phase 1: Install build dependencies for phase 2. Note: RV_PYTHON_BUILD_DEPS is kept as a CMake list (semicolon-separated) so it expands to separate arguments. SET(_build_deps_install_command - "${_python3_executable}" -s -E -I -m pip install --upgrade --no-cache-dir ${_build_deps_packages} + "${_python3_executable}" -s -E -I -m pip install --upgrade --no-cache-dir ${RV_PYTHON_BUILD_DEPS} ) # Phase 2: Install main requirements (with build-from-source for native extensions) From cf9ba6279336f3d722b5f74e264e03e7234f6471 Mon Sep 17 00:00:00 2001 From: Roger Nelson Date: Thu, 8 Jan 2026 14:41:44 -0500 Subject: [PATCH 6/7] Use patch file to build PyOpenGL_accelerate Signed-off-by: Roger Nelson --- cmake/dependencies/python3.cmake | 61 +++++++++++++++----------------- src/build/requirements.txt.in | 8 ++--- 2 files changed, 31 insertions(+), 38 deletions(-) diff --git a/cmake/dependencies/python3.cmake b/cmake/dependencies/python3.cmake index 9c7bc8cd0..667181f6c 100644 --- a/cmake/dependencies/python3.cmake +++ b/cmake/dependencies/python3.cmake @@ -391,38 +391,35 @@ EXTERNALPROJECT_ADD( # ############################################################################################################################################################## # This is temporary until the patch gets into the official PyOpenGL repo. # # ############################################################################################################################################################## -# Only for Apple Intel. Windows and Linux uses the requirements.txt file to install PyOpenGL-accelerate. -IF(APPLE - AND RV_TARGET_APPLE_X86_64 -) - MESSAGE(STATUS "Patching PyOpenGL and building PyOpenGL from source") - SET(_patch_pyopengl_command - patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/pyopengl-accelerate.patch - ) - - # TODO: pyopengl is now at 3.1.10. Need to check if this is an improvement Still need the patch - # https://github.com/mcfletch/pyopengl/blob/master/accelerate/src/vbo.pyx https://github.com/mcfletch/pyopengl/compare/release-3.1.8...3.1.10 - EXTERNALPROJECT_ADD( - pyopengl_accelerate - URL "https://github.com/mcfletch/pyopengl/archive/refs/tags/release-3.1.8.tar.gz" - URL_MD5 "d7a9e2f8c2d981b58776ded865b3e22a" - DOWNLOAD_NAME release-3.1.8.tar.gz - DOWNLOAD_DIR ${RV_DEPS_DOWNLOAD_DIR} - DOWNLOAD_EXTRACT_TIMESTAMP TRUE - SOURCE_DIR ${CMAKE_BINARY_DIR}/pyopengl_accelerate - PATCH_COMMAND ${_patch_pyopengl_command} - CONFIGURE_COMMAND "" - BUILD_COMMAND "${_python3_executable}" -m pip install ./accelerate - INSTALL_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/pyopengl_accelerate/.pip_installed - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/pyopengl_accelerate/setup.py - DEPENDS ${${_python3_target}-requirements-flag} - BUILD_IN_SOURCE TRUE - USES_TERMINAL_BUILD TRUE - ) - - # Ensure pyopengl_accelerate is built as part of the dependencies target - ADD_DEPENDENCIES(dependencies pyopengl_accelerate) -ENDIF() +# Build PyOpenGL_accelerate from patched source. The patch fixes Python 3 compatibility (long -> ctypes.c_long) that newer Cython versions require. +# Once this is fixed just add PyOpenGL_accelerate into the requirements.txt.in file and remove the patch. +MESSAGE(STATUS "Patching PyOpenGL_accelerate and building from source") +SET(_patch_pyopengl_command + patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/pyopengl-accelerate.patch +) + +# TODO: pyopengl is now at 3.1.10. Need to check if this is an improvement Still need the patch +# https://github.com/mcfletch/pyopengl/blob/master/accelerate/src/vbo.pyx https://github.com/mcfletch/pyopengl/compare/release-3.1.8...3.1.10 +EXTERNALPROJECT_ADD( + pyopengl_accelerate + URL "https://github.com/mcfletch/pyopengl/archive/refs/tags/release-3.1.8.tar.gz" + URL_MD5 "d7a9e2f8c2d981b58776ded865b3e22a" + DOWNLOAD_NAME release-3.1.8.tar.gz + DOWNLOAD_DIR ${RV_DEPS_DOWNLOAD_DIR} + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + SOURCE_DIR ${CMAKE_BINARY_DIR}/pyopengl_accelerate + PATCH_COMMAND ${_patch_pyopengl_command} + CONFIGURE_COMMAND "" + BUILD_COMMAND "${_python3_executable}" -m pip install ./accelerate + INSTALL_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/pyopengl_accelerate/.pip_installed + BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/pyopengl_accelerate/setup.py + DEPENDS ${${_python3_target}-requirements-flag} + BUILD_IN_SOURCE TRUE + USES_TERMINAL_BUILD TRUE +) + +# Ensure pyopengl_accelerate is built as part of the dependencies target +ADD_DEPENDENCIES(dependencies pyopengl_accelerate) # ############################################################################################################################################################## # Phase 1 flag: Build dependencies (Cython, etc.) diff --git a/src/build/requirements.txt.in b/src/build/requirements.txt.in index d2236251e..329bc1d90 100644 --- a/src/build/requirements.txt.in +++ b/src/build/requirements.txt.in @@ -13,14 +13,10 @@ numpy==@_numpy_version@ # License: BSD License (BSD-3-Clause) - Required by PySi opentimelineio==@_opentimelineio_version@ # License: Other/Proprietary License (Modified Apache 2.0 License) PyOpenGL==3.1.7 # License: BSD License (BSD) -# MacOS only - PyOpenGL_accelerate is built from source in python3.cmake as a workaround until the fix -# is merged in the main branch. +# PyOpenGL_accelerate is built from source with a patch in python3.cmake for all x86_64 platforms. +# The patch fixes Python 3 compatibility issues (long -> ctypes.c_long) with newer Cython versions. # See https://github.com/mcfletch/pyopengl/issues/147 and https://github.com/mcfletch/pyopengl/pull/146 -# PyOpenGL_accelerate has issue with native arm64 build on MacOS. -# Use PyOpenGL_accelerate only on x86_64 platform. -PyOpenGL_accelerate==3.1.7 ; (platform_system=='Windows' or platform_system=='Linux') and platform_machine=='x86_64' # License: BSD License (BSD) - # Additional packages required by RV and for testing the Python distribution certifi==2024.2.2 # License: Mozilla Public License 2.0 (MPL 2.0) (MPL-2.0) From 6b9247327512aa0895efbd34f28a995adaf74531 Mon Sep 17 00:00:00 2001 From: Roger Nelson Date: Thu, 8 Jan 2026 14:52:04 -0500 Subject: [PATCH 7/7] Use PyOpenGL_accelerate fix instead of patch Signed-off-by: Roger Nelson --- .../patch/pyopengl-accelerate.patch | 12 ------- cmake/dependencies/python3.cmake | 34 ------------------- src/build/requirements.txt.in | 5 +-- 3 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 cmake/dependencies/patch/pyopengl-accelerate.patch diff --git a/cmake/dependencies/patch/pyopengl-accelerate.patch b/cmake/dependencies/patch/pyopengl-accelerate.patch deleted file mode 100644 index a4f18b7b2..000000000 --- a/cmake/dependencies/patch/pyopengl-accelerate.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/accelerate/src/vbo.pyx b/accelerate/src/vbo.pyx -index 13f9e99d..6e92c059 100644 ---- a/accelerate/src/vbo.pyx -+++ b/accelerate/src/vbo.pyx -@@ -1,6 +1,7 @@ - """Cython-coded VBO implementation""" - #cython: language_level=3 - import ctypes, weakref -+from ctypes import c_long as long - from OpenGL_accelerate.formathandler cimport FormatHandler - from OpenGL import error - from OpenGL._bytes import bytes,unicode diff --git a/cmake/dependencies/python3.cmake b/cmake/dependencies/python3.cmake index 667181f6c..8f8337b78 100644 --- a/cmake/dependencies/python3.cmake +++ b/cmake/dependencies/python3.cmake @@ -388,40 +388,6 @@ EXTERNALPROJECT_ADD( USES_TERMINAL_BUILD TRUE ) -# ############################################################################################################################################################## -# This is temporary until the patch gets into the official PyOpenGL repo. # -# ############################################################################################################################################################## -# Build PyOpenGL_accelerate from patched source. The patch fixes Python 3 compatibility (long -> ctypes.c_long) that newer Cython versions require. -# Once this is fixed just add PyOpenGL_accelerate into the requirements.txt.in file and remove the patch. -MESSAGE(STATUS "Patching PyOpenGL_accelerate and building from source") -SET(_patch_pyopengl_command - patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/pyopengl-accelerate.patch -) - -# TODO: pyopengl is now at 3.1.10. Need to check if this is an improvement Still need the patch -# https://github.com/mcfletch/pyopengl/blob/master/accelerate/src/vbo.pyx https://github.com/mcfletch/pyopengl/compare/release-3.1.8...3.1.10 -EXTERNALPROJECT_ADD( - pyopengl_accelerate - URL "https://github.com/mcfletch/pyopengl/archive/refs/tags/release-3.1.8.tar.gz" - URL_MD5 "d7a9e2f8c2d981b58776ded865b3e22a" - DOWNLOAD_NAME release-3.1.8.tar.gz - DOWNLOAD_DIR ${RV_DEPS_DOWNLOAD_DIR} - DOWNLOAD_EXTRACT_TIMESTAMP TRUE - SOURCE_DIR ${CMAKE_BINARY_DIR}/pyopengl_accelerate - PATCH_COMMAND ${_patch_pyopengl_command} - CONFIGURE_COMMAND "" - BUILD_COMMAND "${_python3_executable}" -m pip install ./accelerate - INSTALL_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/pyopengl_accelerate/.pip_installed - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/pyopengl_accelerate/setup.py - DEPENDS ${${_python3_target}-requirements-flag} - BUILD_IN_SOURCE TRUE - USES_TERMINAL_BUILD TRUE -) - -# Ensure pyopengl_accelerate is built as part of the dependencies target -ADD_DEPENDENCIES(dependencies pyopengl_accelerate) -# ############################################################################################################################################################## - # Phase 1 flag: Build dependencies (Cython, etc.) SET(${_python3_target}-build-deps-flag ${_install_dir}/${_python3_target}-build-deps-flag diff --git a/src/build/requirements.txt.in b/src/build/requirements.txt.in index 329bc1d90..f5e26a869 100644 --- a/src/build/requirements.txt.in +++ b/src/build/requirements.txt.in @@ -12,10 +12,7 @@ wheel==0.43.0 # License: MIT License (MIT) numpy==@_numpy_version@ # License: BSD License (BSD-3-Clause) - Required by PySide6 opentimelineio==@_opentimelineio_version@ # License: Other/Proprietary License (Modified Apache 2.0 License) PyOpenGL==3.1.7 # License: BSD License (BSD) - -# PyOpenGL_accelerate is built from source with a patch in python3.cmake for all x86_64 platforms. -# The patch fixes Python 3 compatibility issues (long -> ctypes.c_long) with newer Cython versions. -# See https://github.com/mcfletch/pyopengl/issues/147 and https://github.com/mcfletch/pyopengl/pull/146 +PyOpenGL_accelerate==3.1.10 # License: BSD License (BSD) - v3.1.10 includes Python 3 fix for Cython compatibility # Additional packages required by RV and for testing the Python distribution