[Bf-blender-cvs] [b96d531] master: Python: move to version 3.4x on all platforms

Campbell Barton noreply at git.blender.org
Wed Apr 30 15:21:11 CEST 2014


Commit: b96d531bc97ec763e96a5f7a28993d70a0a9e637
Author: Campbell Barton
Date:   Wed Apr 30 23:13:25 2014 +1000
https://developer.blender.org/rBb96d531bc97ec763e96a5f7a28993d70a0a9e637

Python: move to version 3.4x on all platforms

===================================================================

M	CMakeLists.txt
M	build_files/build_environment/install_deps.sh
M	build_files/cmake/Modules/FindPythonLibsUnix.cmake
M	build_files/scons/config/Modules/FindPython.py
M	build_files/scons/config/freebsd8-config.py
M	build_files/scons/config/freebsd9-config.py
M	build_files/scons/config/linuxcross-config.py
M	build_files/scons/config/win32-mingw-config.py
M	build_files/scons/config/win32-vc-config.py
M	build_files/scons/config/win64-mingw-config.py
M	build_files/scons/config/win64-vc-config.py
M	source/blender/python/generic/py_capi_utils.c
M	source/blender/python/generic/py_capi_utils.h
M	source/blender/python/intern/bpy_util.h

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74a662a..cb10414 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -556,14 +556,14 @@ set(PLATFORM_LINKFLAGS_DEBUG "")
 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
 # On Unix:
 #   cmake ../blender \
-#         -D PYTHON_VERSION=3.3 \
-#         -D PYTHON_INCLUDE_DIR=/opt/py33/include/python3.3d \
-#         -D PYTHON_LIBRARY=/opt/py33/lib/libpython3.3d.so
+#         -D PYTHON_VERSION=3.4 \
+#         -D PYTHON_INCLUDE_DIR=/opt/py34/include/python3.4d \
+#         -D PYTHON_LIBRARY=/opt/py34/lib/libpython3.4d.so
 #
 # On Macs:
 #   cmake ../blender \
-#         -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.3/include/python3.3 \
-#         -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/config \
+#         -D PYTHON_INCLUDE_DIR=/System/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4 \
+#         -D PYTHON_LIBPATH=/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/config \
 #         -G Xcode
 #
 # When changing any of this remember to update the notes in doc/build_systems/cmake.txt
@@ -591,7 +591,7 @@ if(UNIX AND NOT APPLE)
 	find_package_wrapper(Freetype REQUIRED)
 
 	if(WITH_PYTHON)
-		# No way to set py33. remove for now.
+		# No way to set py34. remove for now.
 		# find_package(PythonLibs)
 
 		# Use our own instead, since wothout py is such a rare case,
@@ -1200,7 +1200,7 @@ elseif(WIN32)
 		endif()
 
 		if(WITH_PYTHON)
-			set(PYTHON_VERSION 3.3) # CACHE STRING)
+			set(PYTHON_VERSION 3.4) # CACHE STRING)
 
 			string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
 			# Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
@@ -1452,9 +1452,11 @@ elseif(WIN32)
 
 		if(WITH_PYTHON)
 			# normally cached but not since we include them with blender
-			set(PYTHON_VERSION 3.3) #  CACHE STRING)
+			set(PYTHON_VERSION 3.4) #  CACHE STRING)
+			string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
 			set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")  # CACHE PATH)
-			set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python33mw.lib")  # CACHE FILEPATH)
+			set(PYTHON_LIBRARY "${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}mw.lib")  # CACHE FILEPATH)
+			unset(_PYTHON_VERSION_NO_DOTS)
 
 			# uncached vars
 			set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
diff --git a/build_files/build_environment/install_deps.sh b/build_files/build_environment/install_deps.sh
index 3cc6997..2c513d4 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -177,7 +177,7 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
 
     --required-numpy
         Use this in case your distro features a valid python package, but no matching Numpy one.
-        It will force compilation of both python 3.3 and numpy 1.7.
+        It will force compilation of both python and numpy
 
     --libyaml-cpp-ver=<ver>
         Ubuntu hack: you may have to force installation of a non-defaut version of libyaml-cpp
@@ -648,7 +648,7 @@ _init_python() {
   _src=$SRC/Python-$PYTHON_VERSION
   _git=false
   _inst=$INST/python-$PYTHON_VERSION
-  _inst_shortcut=$INST/python-3.3
+  _inst_shortcut=$INST/python-$PYTHON_VERSION_MIN
 }
 
 clean_Python() {
@@ -713,7 +713,7 @@ _init_numpy() {
   _git=false
   _inst=$INST/numpy-$NUMPY_VERSION
   _python=$INST/python-$PYTHON_VERSION
-  _site=lib/python3.3/site-packages
+  _site=lib/python$PYTHON_VERSION_MIN/site-packages
   _inst_shortcut=$_python/$_site/numpy
 }
 
diff --git a/build_files/cmake/Modules/FindPythonLibsUnix.cmake b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
index 30019eb..5656d33 100644
--- a/build_files/cmake/Modules/FindPythonLibsUnix.cmake
+++ b/build_files/cmake/Modules/FindPythonLibsUnix.cmake
@@ -37,7 +37,7 @@ IF(NOT PYTHON_ROOT_DIR AND NOT $ENV{PYTHON_ROOT_DIR} STREQUAL "")
   SET(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR})
 ENDIF()
 
-SET(PYTHON_VERSION 3.3 CACHE STRING "Python Version (major and minor only)")
+SET(PYTHON_VERSION 3.4 CACHE STRING "Python Version (major and minor only)")
 MARK_AS_ADVANCED(PYTHON_VERSION)
 
 
@@ -188,7 +188,7 @@ IF(PYTHONLIBSUNIX_FOUND)
   SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
 
   # we need this for installation
-  # XXX No more valid with debian-like py3.3 packages...
+  # XXX No more valid with debian-like py3.4 packages...
 #  GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
 
   # not used
diff --git a/build_files/scons/config/Modules/FindPython.py b/build_files/scons/config/Modules/FindPython.py
index f7956e9..a0ead88 100644
--- a/build_files/scons/config/Modules/FindPython.py
+++ b/build_files/scons/config/Modules/FindPython.py
@@ -6,7 +6,7 @@ def FindPython():
 
     python = "/usr"
     abi_flags = "m"  # Most common for linux distros
-    version = "3.3"
+    version = "3.4"
 
     _arch = platform.uname()[4] + "-linux-gnu"
 
diff --git a/build_files/scons/config/freebsd8-config.py b/build_files/scons/config/freebsd8-config.py
index b7c6fed..08c234b 100644
--- a/build_files/scons/config/freebsd8-config.py
+++ b/build_files/scons/config/freebsd8-config.py
@@ -7,7 +7,7 @@ LIBDIR = "${LCGDIR}"
 BF_PYTHON_ABI_FLAGS = ''
 BF_PYTHON = '/usr/local'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
-BF_PYTHON_VERSION = '3.3'
+BF_PYTHON_VERSION = '3.4'
 WITH_BF_STATICPYTHON = False
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'
 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
diff --git a/build_files/scons/config/freebsd9-config.py b/build_files/scons/config/freebsd9-config.py
index 8535ece..e17124c 100644
--- a/build_files/scons/config/freebsd9-config.py
+++ b/build_files/scons/config/freebsd9-config.py
@@ -7,7 +7,7 @@ LIBDIR = "${LCGDIR}"
 BF_PYTHON_ABI_FLAGS = ''
 BF_PYTHON = '/usr/local'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
-BF_PYTHON_VERSION = '3.3'
+BF_PYTHON_VERSION = '3.4'
 WITH_BF_STATICPYTHON = False
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'
 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
diff --git a/build_files/scons/config/linuxcross-config.py b/build_files/scons/config/linuxcross-config.py
index 36b29a3..e62e000 100644
--- a/build_files/scons/config/linuxcross-config.py
+++ b/build_files/scons/config/linuxcross-config.py
@@ -2,7 +2,7 @@ LCGDIR = '#../lib/windows'
 LIBDIR = '${LCGDIR}'
 
 BF_PYTHON = LIBDIR + '/python'
-BF_PYTHON_VERSION = '3.3'
+BF_PYTHON_VERSION = '3.4'
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = 'python'
 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}mw'
diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py
index b3b7f98..3a5a02f 100644
--- a/build_files/scons/config/win32-mingw-config.py
+++ b/build_files/scons/config/win32-mingw-config.py
@@ -2,7 +2,7 @@ LCGDIR = '#../lib/mingw32'
 LIBDIR = "${LCGDIR}"
 
 BF_PYTHON = LIBDIR + '/python'
-BF_PYTHON_VERSION = '3.3'
+BF_PYTHON_VERSION = '3.4'
 WITH_BF_STATICPYTHON = False
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = 'python'
diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py
index ad01c28..bb9bcc3 100644
--- a/build_files/scons/config/win32-vc-config.py
+++ b/build_files/scons/config/win32-vc-config.py
@@ -31,7 +31,7 @@ else:
     BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-55.dll ${BF_FFMPEG_LIBPATH}/avcodec-55.dll ${BF_FFMPEG_LIBPATH}/avdevice-55.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
 
 BF_PYTHON = LIBDIR + '/python'
-BF_PYTHON_VERSION = '3.3'
+BF_PYTHON_VERSION = '3.4'
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = 'python'
 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
diff --git a/build_files/scons/config/win64-mingw-config.py b/build_files/scons/config/win64-mingw-config.py
index cd49296..6efbf5b 100644
--- a/build_files/scons/config/win64-mingw-config.py
+++ b/build_files/scons/config/win64-mingw-config.py
@@ -2,7 +2,7 @@ LCGDIR = '#../lib/mingw64'
 LIBDIR = "${LCGDIR}"
 
 BF_PYTHON = LIBDIR + '/python'
-BF_PYTHON_VERSION = '3.3'
+BF_PYTHON_VERSION = '3.4'
 WITH_BF_STATICPYTHON = False
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = 'python'
diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py
index 204a4a9..9c32972 100644
--- a/build_files/scons/config/win64-vc-config.py
+++ b/build_files/scons/config/win64-vc-config.py
@@ -32,7 +32,7 @@ else:
     
 
 BF_PYTHON = LIBDIR + '/python'
-BF_PYTHON_VERSION = '3.3'
+BF_PYTHON_VERSION = '3.4'
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = 'python'
 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}'
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 44b551c..33ff63a 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -904,19 +904,3 @@ PyObject *PyC_FlagSet_FromBitfield(PyC_FlagSet *items, int flag)
 
 	return ret;
 }
-
-/* compat only */
-#if PY_VERSION_HEX <  0x03030200
-int
-_PyLong_AsInt(PyObject *obj)
-{
-	int overflow;
-	long result = PyLong_AsLongAndOverflow(obj, &overflow);
-	if (overflow || result > INT_MAX || result < INT_MIN) {
-		PyErr_SetString(PyExc_OverflowError,
-		                "Python int too large to convert to C int");
-		return -1;
-	}
-	return (int)result;
-}
-#endif
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 27dd1bb..0afc4dd 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -73,8 +73,4 @@ int       PyC_FlagSet_ValueFromID(PyC_FlagSet *item, const char *identifier, int
 int       PyC_FlagSet_ToBitfield(PyC_FlagSet *items, PyObject *value, int *r_value, const c

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list