Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b761f0d
Build all python package dependencies
rogernelson Dec 1, 2025
2bc9483
ci
cedrik-fuoco-adsk Dec 3, 2025
8b79960
tentative fix
cedrik-fuoco-adsk Dec 3, 2025
9c1c7c1
try to fix rust for msys2
cedrik-fuoco-adsk Dec 3, 2025
7a53e94
try to fix rust for msys2
cedrik-fuoco-adsk Dec 3, 2025
d5d65a4
try to fix rust for msys2
cedrik-fuoco-adsk Dec 3, 2025
85386b6
fix crypography for openssl
cedrik-fuoco-adsk Dec 4, 2025
e7fed17
try to fix crypography build in windows debug
cedrik-fuoco-adsk Dec 4, 2025
8658b04
fix issue for rocky 8 2023 where the openssl comes from the system
cedrik-fuoco-adsk Dec 4, 2025
90afb09
remove debug steps
cedrik-fuoco-adsk Dec 4, 2025
e5b96fe
documentation
cedrik-fuoco-adsk Dec 16, 2025
c957a0f
fix windows doc
cedrik-fuoco-adsk Dec 17, 2025
a96eaf4
fix windows doc
cedrik-fuoco-adsk Dec 17, 2025
607f460
clean up packages installation in requirements.txt only and testing p…
cedrik-fuoco-adsk Dec 18, 2025
fec9b95
move numpy out of pyside script and build it from scratch
cedrik-fuoco-adsk Dec 18, 2025
322f330
small fix
cedrik-fuoco-adsk Dec 18, 2025
aeb7235
Merge branch 'main' into cleanup-make-python
cedrik-fuoco-adsk Dec 18, 2025
2f68b52
fix issue with sitecustomize.py during build of python dependencies b…
cedrik-fuoco-adsk Dec 18, 2025
01332eb
build known packages with c/c++/rust extension to prevent building pa…
cedrik-fuoco-adsk Dec 18, 2025
9813620
Merge branch 'main' into cleanup-make-python
cedrik-fuoco-adsk Dec 18, 2025
0962044
cffi
cedrik-fuoco-adsk Dec 19, 2025
58aa660
ruff
cedrik-fuoco-adsk Dec 19, 2025
8e29259
ruff formatting
cedrik-fuoco-adsk Dec 19, 2025
1e7d934
build from source by default and list the ones that dont need too
cedrik-fuoco-adsk Dec 19, 2025
bf6475d
add more packages
cedrik-fuoco-adsk Dec 19, 2025
1f2f811
move sitecustomize outside of make_python, small changes
cedrik-fuoco-adsk Dec 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmake/defaults/CY2023.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ IF(RV_VFX_PLATFORM STREQUAL "CY2023")
SET(RV_DEPS_IMATH_LIB_MAJOR "3_1")

# NumPy
# NumPY for CY2023 is 1.23.x series but Pyside2 requires < 1.23
# So we comment this out and make_pyside.py hardcoded to use NumPy < 1.23
#SET(ENV{RV_DEPS_NUMPY_VERSION} "1.23.5")
# NumPy for CY2023 VFX platform is 1.23.x series, but PySide2 requires < 1.23
# Using numpy 1.22.4 (last version before 1.23) for PySide2 compatibility
SET(RV_DEPS_NUMPY_VERSION "1.22.4")

# OCIO
# https://github.com/AcademySoftwareFoundation/OpenColorIO
Expand Down
2 changes: 1 addition & 1 deletion cmake/defaults/CY2024.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ IF(RV_VFX_PLATFORM STREQUAL "CY2024")

# NumPy
# https://numpy.org/doc/stable/release.html
SET(ENV{RV_DEPS_NUMPY_VERSION} "1.24.4")
SET(RV_DEPS_NUMPY_VERSION "1.24.4")

# OCIO
# https://github.com/AcademySoftwareFoundation/OpenColorIO
Expand Down
2 changes: 1 addition & 1 deletion cmake/defaults/CY2025.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ IF(RV_VFX_PLATFORM STREQUAL "CY2025")

# NumPy
# https://numpy.org/doc/stable/release.html
SET(ENV{RV_DEPS_NUMPY_VERSION} "1.26.4")
SET(RV_DEPS_NUMPY_VERSION "1.26.4")

# OCIO
# https://github.com/AcademySoftwareFoundation/OpenColorIO
Expand Down
2 changes: 1 addition & 1 deletion cmake/defaults/CY2026.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ IF(RV_VFX_PLATFORM STREQUAL "CY2026")

# NumPy
# https://numpy.org/doc/stable/release.html
SET(ENV{RV_DEPS_NUMPY_VERSION} "2.3.0")
SET(RV_DEPS_NUMPY_VERSION "2.3.0")

# OCIO
# https://github.com/AcademySoftwareFoundation/OpenColorIO
Expand Down
127 changes: 94 additions & 33 deletions cmake/dependencies/python3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ SET(_pyside_version
"${RV_DEPS_PYSIDE_VERSION}"
)

SET(_numpy_version
"${RV_DEPS_NUMPY_VERSION}"
)

SET(_python3_download_url
"https://github.com/python/cpython/archive/refs/tags/v${_python3_version}.zip"
)
Expand Down Expand Up @@ -233,15 +237,18 @@ ELSE() # Not WINDOWS
)
ENDIF()

# Set the appropriate library for CMAKE_ARGS based on platform
# Windows needs the import library (.lib), Unix needs the shared library (.so/.dylib)
# Set the appropriate library for CMAKE_ARGS based on platform Windows needs the import library (.lib), Unix needs the shared library (.so/.dylib)
IF(RV_TARGET_WINDOWS)
SET(_python3_cmake_library ${_python3_implib})
SET(_python3_cmake_library
${_python3_implib}
)
ELSE()
SET(_python3_cmake_library ${_python3_lib})
SET(_python3_cmake_library
${_python3_lib}
)
ENDIF()

# Generate requirements.txt from template with the OpenTimelineIO version substituted
# Generate requirements.txt from template with the OpenTimelineIO and NumPy versions substituted
SET(_requirements_input_file
"${PROJECT_SOURCE_DIR}/src/build/requirements.txt.in"
)
Expand All @@ -251,38 +258,75 @@ SET(_requirements_output_file

CONFIGURE_FILE(${_requirements_input_file} ${_requirements_output_file} @ONLY)

# OpenTimelineIO needs to be built from source with CMAKE_ARGS to ensure it uses
# the correct custom-built Python libraries. This is required for both old and new
# versions of pybind11, especially pybind11 v2.13.6+ which has stricter detection.
# Note: pybind11's FindPythonLibsNew.cmake uses PYTHON_LIBRARY (all caps),
# PYTHON_INCLUDE_DIR, and PYTHON_EXECUTABLE variables.
# --no-cache-dir: Don't use pip's wheel cache (prevents using wheels built for wrong Python version)
# OpenTimelineIO needs to be built from source with CMAKE_ARGS to ensure it uses the correct custom-built Python libraries. This is required for both old and
# new versions of pybind11, especially pybind11 v2.13.6+ which has stricter detection. Note: pybind11's FindPythonLibsNew.cmake uses PYTHON_LIBRARY (all caps),
# PYTHON_INCLUDE_DIR, and PYTHON_EXECUTABLE variables. --no-cache-dir: Don't use pip's wheel cache (prevents using wheels built for wrong Python version)
# --force-reinstall: Reinstall packages even if already installed (ensures fresh build)

# Set OTIO_CXX_DEBUG_BUILD for all Debug builds to ensure OTIO's C++ extensions
# are built with debug symbols and proper optimization levels matching RV's build type.
# On Windows, this also ensures OTIO links against the debug Python library (python311_d.lib).
# Set OTIO_CXX_DEBUG_BUILD for all Debug builds to ensure OTIO's C++ extensions are built with debug symbols and proper optimization levels matching RV's build
# type. On Windows, this also ensures OTIO links against the debug Python library (python311_d.lib).
IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
SET(_otio_debug_env "OTIO_CXX_DEBUG_BUILD=1")
SET(_otio_debug_env
"OTIO_CXX_DEBUG_BUILD=1"
)
ELSE()
SET(_otio_debug_env "")
SET(_otio_debug_env
""
)
ENDIF()

# Using --no-binary :all: to ensure all packages with native extensions are built from source
# against our custom Python build, preventing ABI compatibility issues.
# 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
"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)
"meson-python" # Build backend (pure Python)
"ninja" # Build tool (native but doesn't link to Python)
"PyOpenGL" # OpenGL bindings without acceleration (pure Python)
"certifi" # SSL certificate bundle (just data files)
"six" # Python 2/3 compatibility (pure Python)
"packaging" # Version parsing (pure Python)
"requests" # HTTP library (pure Python)
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
STRING(REPLACE ";" "," _wheel_safe_packages "${RV_PYTHON_WHEEL_SAFE}")

SET(_requirements_install_command
${CMAKE_COMMAND} -E env
${_otio_debug_env}
${CMAKE_COMMAND} -E env ${_otio_debug_env}
)

# Only set OPENSSL_DIR if we built OpenSSL ourselves (not for Rocky Linux 8 CY2023 which uses system OpenSSL)
IF(DEFINED RV_DEPS_OPENSSL_INSTALL_DIR)
LIST(APPEND _requirements_install_command "OPENSSL_DIR=${RV_DEPS_OPENSSL_INSTALL_DIR}")
ENDIF()

LIST(APPEND _requirements_install_command
"CMAKE_ARGS=-DPYTHON_LIBRARY=${_python3_cmake_library} -DPYTHON_INCLUDE_DIR=${_include_dir} -DPYTHON_EXECUTABLE=${_python3_executable}"
"${_python3_executable}" -s -E -I -m pip install --upgrade --no-cache-dir --force-reinstall --no-binary :all: -r "${_requirements_output_file}"
# Build all packages from source except those in RV_PYTHON_WHEEL_SAFE. Packages with native extensions (opentimelineio, numpy, PyOpenGL-accelerate,
# cryptography, pydantic, cffi, etc.) will be built from source for proper ABI compatibility.
LIST(
APPEND
_requirements_install_command
"CMAKE_ARGS=-DPYTHON_LIBRARY=${_python3_cmake_library} -DPYTHON_INCLUDE_DIR=${_include_dir} -DPYTHON_EXECUTABLE=${_python3_executable}"
"${_python3_executable}"
-s
-E
-I
-m
pip
install
--upgrade
--no-cache-dir
--force-reinstall
--no-binary
:all:
--only-binary
${_wheel_safe_packages}
-r
"${_requirements_output_file}"
)

IF(RV_TARGET_WINDOWS)
Expand Down Expand Up @@ -373,27 +417,44 @@ SET(${_python3_target}-requirements-flag
)

ADD_CUSTOM_COMMAND(
COMMENT "Installing requirements from ${_requirements_output_file}"
COMMENT "Installing requirements from ${_requirements_output_file} pyside and other dependencies"
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}
)

# Test the Python distribution after requirements are installed
SET(${_python3_target}-test-flag
${_install_dir}/${_python3_target}-test-flag
)

SET(_test_python_script
"${PROJECT_SOURCE_DIR}/src/build/test_python.py"
)

ADD_CUSTOM_COMMAND(
COMMENT "Testing Python distribution"
OUTPUT ${${_python3_target}-test-flag}
COMMAND python3 "${_test_python_script}" --python-home "${_install_dir}" --variant "${CMAKE_BUILD_TYPE}"
COMMAND cmake -E touch ${${_python3_target}-test-flag}
DEPENDS ${${_python3_target}-requirements-flag} ${_test_python_script}
)

IF(RV_TARGET_WINDOWS
AND CMAKE_BUILD_TYPE MATCHES "^Debug$"
)
# OCIO v2.2's pybind11 doesn't find python<ver>.lib in Debug since the name is python<ver>_d.lib.
# Also, Rust libraries (like cryptography via pyo3) look for python3.lib.
# OCIO v2.2's pybind11 doesn't find python<ver>.lib in Debug since the name is python<ver>_d.lib. Also, Rust libraries (like cryptography via pyo3) look for
# python3.lib.
ADD_CUSTOM_COMMAND(
TARGET ${_python3_target}
POST_BUILD
COMMENT "Copying Debug Python lib as a unversionned file for Debug"
COMMAND cmake -E copy_if_different ${_python3_implib} ${_python_release_libpath}
COMMAND cmake -E copy_if_different ${_python3_implib} ${_python_release_in_bin_libpath}
COMMAND cmake -E copy_if_different ${_lib_dir}/python${PYTHON_VERSION_MAJOR}_d.lib ${_lib_dir}/python${PYTHON_VERSION_MAJOR}.lib
COMMAND cmake -E copy_if_different ${_bin_dir}/python${PYTHON_VERSION_MAJOR}_d.lib ${_bin_dir}/python${PYTHON_VERSION_MAJOR}.lib
DEPENDS ${_python3_target} ${_requirements_output_file} ${_requirements_input_file}
COMMAND cmake -E copy_if_different ${_bin_dir}/python${PYTHON_VERSION_MAJOR}_d.lib ${_bin_dir}/python${PYTHON_VERSION_MAJOR}.lib DEPENDS ${_python3_target}
${_requirements_output_file} ${_requirements_input_file}
)
ENDIF()

Expand All @@ -410,7 +471,7 @@ IF(RV_VFX_PLATFORM STREQUAL CY2023)
${rv_deps_pyside2_SOURCE_DIR}/build_scripts/platforms/windows_desktop.py
COMMAND ${_pyside_make_command} --prepare --build
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag} ${${_python3_target}-test-flag}
USES_TERMINAL
)

Expand All @@ -421,9 +482,9 @@ ELSEIF(RV_VFX_PLATFORM STRGREATER_EQUAL CY2024)
ADD_CUSTOM_COMMAND(
COMMENT "Building PySide6 using ${_pyside_make_command_script}"
OUTPUT ${${_pyside_target}-build-flag}
COMMAND ${CMAKE_COMMAND} -E env "RV_DEPS_NUMPY_VERSION=$ENV{RV_DEPS_NUMPY_VERSION}" ${_pyside_make_command} --prepare --build
COMMAND ${_pyside_make_command} --prepare --build
COMMAND cmake -E touch ${${_pyside_target}-build-flag}
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag}
DEPENDS ${_python3_target} ${_pyside_make_command_script} ${${_python3_target}-requirements-flag} ${${_python3_target}-test-flag}
USES_TERMINAL
)

Expand Down Expand Up @@ -454,7 +515,7 @@ IF(RV_TARGET_WINDOWS)
ADD_CUSTOM_COMMAND(
COMMENT "Installing ${_python3_target}'s include and libs into ${RV_STAGE_LIB_DIR}"
OUTPUT ${RV_STAGE_BIN_DIR}/${_python3_lib_name} ${_copy_commands}
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${${_python3_target}-test-flag} ${_build_flag_depends}
)

ADD_CUSTOM_TARGET(
Expand All @@ -468,7 +529,7 @@ ELSE()
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/lib ${RV_STAGE_LIB_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/include ${RV_STAGE_INCLUDE_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${_install_dir}/bin ${RV_STAGE_BIN_DIR}
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${_build_flag_depends}
DEPENDS ${_python3_target} ${${_python3_target}-requirements-flag} ${${_python3_target}-test-flag} ${_build_flag_depends}
)
ADD_CUSTOM_TARGET(
${_python3_target}-stage-target ALL
Expand Down
13 changes: 1 addition & 12 deletions src/build/make_pyside6.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,7 @@ def get_fallback_clang_filename_suffix(version):
os.environ["LLVM_INSTALL_DIR"] = libclang_install_dir
os.environ["CLANG_INSTALL_DIR"] = libclang_install_dir

# PySide6 build requires numpy 1.26.3
numpy_version = os.environ.get("RV_DEPS_NUMPY_VERSION")
if not numpy_version:
raise ValueError("RV_DEPS_NUMPY_VERSION environment variable is not set.")
install_numpy_args = get_python_interpreter_args(PYTHON_OUTPUT_DIR, VARIANT) + [
"-m",
"pip",
"install",
f"numpy=={numpy_version}",
]
print(f"Installing numpy with {install_numpy_args}")
subprocess.run(install_numpy_args).check_returncode()
# Note: numpy is now installed via requirements.txt in python3.cmake before PySide6 builds.

cmakelist_path = os.path.join(SOURCE_DIR, "sources", "shiboken6", "ApiExtractor", "CMakeLists.txt")
old_cmakelist_path = os.path.join(SOURCE_DIR, "sources", "shiboken6", "ApiExtractor", "CMakeLists.txt.old")
Expand Down
Loading
Loading