Page MenuHome

PyAPI: Support Python 3.9 (for VFX platform support)
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Sep 21 2022, 2:05 PM.

Details

Summary

Support Python 3.9, part of VFX platform support.

The intention of restoring Python 3.9 support is so it's possible to build a (mostly) VFX compatible version of Blender, not to provide official builds on the buildbot.


Notes:

Diff Detail

Repository
rB Blender
Branch
TEMP-BLENDER-33-PY-39-DOWNGRADE (branched from master)
Build Status
Buildable 23867
Build 23867: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Sep 21 2022, 2:05 PM
Campbell Barton (campbellbarton) created this revision.

For some reason unrelated changes were included.

I think to make the Python version configurable this should be fine for the 3.3 branch:

diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index f84be3c..9487875 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -113,7 +113,7 @@ endif()

 if(WITH_PYTHON)
   # Use precompiled libraries by default.
-  set(PYTHON_VERSION 3.10)
+  SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")
   if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
     # Normally cached but not since we include them with blender.
     set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 7e272ea..456f02b 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -497,7 +497,7 @@ if(WITH_JACK)
 endif()

 if(WITH_PYTHON)
-  set(PYTHON_VERSION 3.10) # CACHE STRING)
+  SET(PYTHON_VERSION 3.10 CACHE STRING "Python Version (major and minor only)")

   string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
   set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib)

To test things build correctly, we could temporarily change the version in this patch to 3.9 in all the platform*.cmake, but still commit with 3.10.

I tested this on the buildbot with D16033 (but as a branch since a patch won't checkout the right libs).

Build seems to complete fine on all platforms, the only test failure is render_povray as expected.
https://builder.blender.org/admin/#/builders/57/builds/1502
https://builder.blender.org/download/experimental/temp-v33-python39/

If you agree to include the proposed change from my previous comment, looks good to me.

This revision is now accepted and ready to land.Sep 21 2022, 11:38 PM