Forráskód Böngészése

3P Build Script Update for Python 3.10.5 (#122)

Updates to support Python 3.10.5 for Windows

- Fix lib references from python37* to python310*
- Fix duplicate entries in PYTHON_LIBRARY_DEBUG and PYTHON_LIBRARY_RELEASE
- Update pyton cmake files to reflect python 3.10.5

Signed-off-by: Steve Pham <[email protected]>
Steve Pham 3 éve
szülő
commit
19c598e697

+ 1 - 1
package-system/python/build_package_image.py

@@ -14,7 +14,7 @@ import os
 import platform
 
 folder_names = { #   subfolder     interpreter     build script 
-    'darwin'     : ('darwin_x64' , 'Python.framework/Versions/3.7/bin/python3', 'make-python.sh'),
+    'darwin'     : ('darwin_x64' , 'Python.framework/Versions/3.10/bin/python3', 'make-python.sh'),
     'linux'      : ('linux_x64'  , 'python/bin/python', 'make-python.sh'),
     'windows'    : ('win_x64'    , 'python/python.exe', 'build_python.bat')
 }

+ 5 - 5
package-system/python/darwin_x64/FindPython.cmake

@@ -23,15 +23,15 @@ endif()
 # Python_PATHS - Where sys.path should point at to find modules, libraries, etc.
 # Python_Development_FOUND - The platform we are cross compiling for can link to python
 # and a target called 3rdParty::Python that you can use to depend on
-set(PY_BASE_DIR ${CMAKE_CURRENT_LIST_DIR}/Python.framework/Versions/3.7)
-set(${MY}_VERSION 3.7.12)
+set(PY_BASE_DIR ${CMAKE_CURRENT_LIST_DIR}/Python.framework/Versions/3.10)
+set(${MY}_VERSION 3.10.5)
 set(${MY}_INTERPRETER_ID    "Python")
 set(${MY}_EXECUTABLE        ${PY_BASE_DIR}/bin/python3)
 set(${MY}_HOME              ${PY_BASE_DIR})
 set(${MY}_PATHS             ${PY_BASE_DIR}/lib
-                            ${PY_BASE_DIR}/lib/python3.7
-                            ${PY_BASE_DIR}/lib/python3.7/lib-dynload
-                            ${PY_BASE_DIR}/lib/python3.7/site-packages) 
+                            ${PY_BASE_DIR}/lib/python3.10
+                            ${PY_BASE_DIR}/lib/python3.10/lib-dynload
+                            ${PY_BASE_DIR}/lib/python3.10/site-packages)
                        
 # only if we're compiling FOR on one of the available platforms, add the target and libraries:
 if (${PAL_PLATFORM_NAME} STREQUAL "Mac" )

+ 1 - 1
package-system/python/darwin_x64/PackageInfo.json

@@ -1,5 +1,5 @@
 {
-    "PackageName" : "python-3.7.12-rev3-darwin",
+    "PackageName" : "python-3.10.5-rev2-darwin",
     "License"     : "PSF-2.0",
     "URL"         : "https://python.org",
     "LicenseFile" : "LICENSE"

+ 12 - 12
package-system/python/darwin_x64/make-python.sh

@@ -59,9 +59,9 @@ cd temp
 mkdir $SCRIPT_DIR/package
 
 echo ""
-echo "---------------- Cloning python 3.7.12 from git ----------------"
+echo "---------------- Cloning python 3.10.5 from git ----------------"
 echo ""
-git clone https://github.com/python/cpython.git --branch "v3.7.12" --depth 1
+git clone https://github.com/python/cpython.git --branch "v3.10.5" --depth 1
 retVal=$?
 if [ $retVal -ne 0 ]; then
     echo "Error cloning python from https://github.com/python/cpython.git"
@@ -167,8 +167,8 @@ cd $RELOC_SRC_DIR
 echo ""
 echo "---------------- Altering the produced framework folder to be relocatable ----------------"
 echo ""
-echo $VENV_BIN_DIR/python3 ./make_relocatable_python_framework.py --install-wheel --upgrade-pip --python-version 3.7.12 --use-existing-framework $FRAMEWORK_OUTPUT_FOLDER/Python.framework
-$VENV_BIN_DIR/python3 ./make_relocatable_python_framework.py --install-wheel --upgrade-pip --python-version 3.7.12 --use-existing-framework $FRAMEWORK_OUTPUT_FOLDER/Python.framework
+echo $VENV_BIN_DIR/python3 ./make_relocatable_python_framework.py --install-wheel --upgrade-pip --python-version 3.10.5 --use-existing-framework $FRAMEWORK_OUTPUT_FOLDER/Python.framework
+$VENV_BIN_DIR/python3 ./make_relocatable_python_framework.py --install-wheel --upgrade-pip --python-version 3.10.5 --use-existing-framework $FRAMEWORK_OUTPUT_FOLDER/Python.framework
 retVal=$?
 if [ $retVal -ne 0 ]; then
     echo "Could not make python relocatable!"
@@ -179,8 +179,8 @@ echo ""
 echo "---------------- Final RPATH update ----------------"
 echo ""
 # The filename of the main python dylib is 'Python'.
-# It is located at ./package/Python.framework/Versions/3.7(symlinked to Current)
-# The original rpath "@rpath/Versions/3.7/Python" is incorrect. When the Python.framework
+# It is located at ./package/Python.framework/Versions/3.10(symlinked to Current)
+# The original rpath "@rpath/Versions/3.10/Python" is incorrect. When the Python.framework
 # is embedded in an app bundle, any executable/shared library linking to it will need to
 # find it in "@rpath/Python.framework/Versions/Current/Python". The executable will have
 # its rpath set to "<bundle_name>.app/Contents/Frameworks".
@@ -188,7 +188,7 @@ echo ""
 # as well as the root of the framework (ie, @loader_path/../../../.. etc), this makes
 # the whole thing work regardless of whether Python is in the same folder as the binary or 
 # whether a python native plugin is being located from the framework in some subfolder.
-install_name_tool -id @rpath/Python.framework/Versions/Current/Python $FRAMEWORK_OUTPUT_FOLDER/Python.framework/Versions/3.7/Python
+install_name_tool -id @rpath/Python.framework/Versions/Current/Python $FRAMEWORK_OUTPUT_FOLDER/Python.framework/Versions/3.10/Python
 
 echo ""
 echo "---------------- rsync package layout into $SCRIPT_DIR/package ----------------"
@@ -201,17 +201,17 @@ echo "---------------- Copying Open3DEngine package metadata and license file --
 echo ""
 # the tar contains a 'Python.framework' sub folder
 cd $SCRIPT_DIR/package
-cp $SCRIPT_DIR/package/Python.framework/Versions/3.7/lib/python3.7/LICENSE.txt ./LICENSE
+cp $SCRIPT_DIR/package/Python.framework/Versions/3.10/lib/python3.10/LICENSE.txt ./LICENSE
 cp $SCRIPT_DIR/PackageInfo.json .
 cp $SCRIPT_DIR/*.cmake .
 
 echo ""
 echo "---------------- Removing pip references from ensurepip ----------------"
 echo ""
-rm -f $SCRIPT_DIR/package/Python.framework/Versions/3.7/lib/python3.7/ensurepip/_bundled/pip-20*.whl
-cat $SCRIPT_DIR/package/Python.framework/Versions/3.7/lib/python3.7/ensurepip/__init__.py | sed 's/"20.1.1"/"22.0.3"/g' | sed 's/("pip", _PIP_VERSION, "py2.py3"),//g' > $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/__init__.py_temp
-rm $SCRIPT_DIR/package/Python.framework/Versions/3.7/lib/python3.7/ensurepip/__init__.py
-mv $SCRIPT_DIR/package/Python.framework/Versions/3.7/lib/python3.7/ensurepip/__init__.py_temp $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/__init__.py
+rm -f $SCRIPT_DIR/package/Python.framework/Versions/3.10/lib/python3.10/ensurepip/_bundled/pip-20*.whl
+cat $SCRIPT_DIR/package/Python.framework/Versions/3.10/lib/python3.10/ensurepip/__init__.py | sed 's/"20.1.1"/"22.0.3"/g' | sed 's/("pip", _PIP_VERSION, "py2.py3"),//g' > $SCRIPT_DIR/package/python/lib/python3.10/ensurepip/__init__.py_temp
+rm $SCRIPT_DIR/package/Python.framework/Versions/3.10/lib/python3.10/ensurepip/__init__.py
+mv $SCRIPT_DIR/package/Python.framework/Versions/3.10/lib/python3.10/ensurepip/__init__.py_temp $SCRIPT_DIR/package/python/lib/python3.10/ensurepip/__init__.py
 
 echo ""
 echo "----------------  Cleaning temp folder ----------------"

+ 24 - 141
package-system/python/darwin_x64/open3d_python.patch

@@ -1,50 +1,26 @@
 diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
-index 4fab488..2f1bd81 100755
+index 4308a20..ec54cfb 100755
 --- a/Mac/BuildScript/build-installer.py
 +++ b/Mac/BuildScript/build-installer.py
-@@ -209,9 +209,9 @@ def library_recipes():
-
-     result.extend([
-           dict(
--              name="OpenSSL 1.1.1g",
--              url="https://www.openssl.org/source/openssl-1.1.1g.tar.gz",
--              checksum='76766e98997660138cdaf13a187bd234',
-+              name="OpenSSL 1.1.1m",
-+              url="https://www.openssl.org/source/openssl-1.1.1m.tar.gz",
-+              checksum='8ec70f665c145c3103f6e330f538a9db',
-               buildrecipe=build_universal_openssl,
-               configure=None,
-               install=None,
-@@ -221,9 +221,9 @@ def library_recipes():
-     if internalTk():
+@@ -274,7 +274,7 @@ def library_recipes():
          result.extend([
            dict(
--              name="Tcl 8.6.8",
--              url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tcl8.6.8-src.tar.gz",
--              checksum='81656d3367af032e0ae6157eff134f89',
-+              name="Tcl 8.6.11",
-+              url="https://prdownloads.sourceforge.net/tcl/tcl8.6.12-src.tar.gz",
-+              checksum='87ea890821d2221f2ab5157bc5eb885f',
+               name="Tcl %s"%(tcl_tk_ver,),
+-              url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tcl%s-src.tar.gz"%(tcl_tk_ver,),
++              url="https://fossies.org/linux/misc/tcl%s-src.tar.gz"%(tcl_tk_ver,),
+               checksum=tcl_checksum,
                buildDir="unix",
                configure_pre=[
-                     '--enable-shared',
-@@ -237,12 +237,9 @@ def library_recipes():
-                   },
+@@ -291,7 +291,7 @@ def library_recipes():
                ),
            dict(
--              name="Tk 8.6.8",
--              url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk8.6.8-src.tar.gz",
--              checksum='5e0faecba458ee1386078fb228d008ba',
--              patches=[
--                  "tk868_on_10_8_10_9.patch",
--                   ],
-+              name="Tk 8.6.11",
-+              url="https://prdownloads.sourceforge.net/tcl/tk8.6.12-src.tar.gz",
-+              checksum='1d6dcf6120356e3d211e056dff5e462a',
+               name="Tk %s"%(tcl_tk_ver,),
+-              url="ftp://ftp.tcl.tk/pub/tcl//tcl8_6/tk%s-src.tar.gz"%(tcl_tk_ver,),
++              url="https://fossies.org/linux/misc/tk%s-src.tar.gz"%(tcl_tk_ver,),
+               checksum=tk_checksum,
+               patches=tk_patches,
                buildDir="unix",
-               configure_pre=[
-                     '--enable-aqua',
-@@ -267,6 +264,7 @@ def library_recipes():
+@@ -318,6 +318,7 @@ def library_recipes():
                checksum='ef68674fb47a8b8e741b34e429d86e9d',
                configure_pre=[
                      '--disable-dependency-tracking',
@@ -52,86 +28,10 @@ index 4fab488..2f1bd81 100755
                ]
                ),
          ])
-@@ -307,9 +305,9 @@ def library_recipes():
-                   ),
-           ),
-           dict(
--              name="SQLite 3.32.2",
--              url="https://sqlite.org/2020/sqlite-autoconf-3320200.tar.gz",
--              checksum='eb498918a33159cdf8104997aad29e83',
-+              name="SQLite 3.37.2",
-+              url="https://sqlite.org/2022/sqlite-autoconf-3370200.tar.gz",
-+              checksum='683cc5312ee74e71079c14d24b7a6d27',
-               extra_cflags=('-Os '
-                             '-DSQLITE_ENABLE_FTS5 '
-                             '-DSQLITE_ENABLE_FTS4 '
-@@ -326,32 +324,32 @@ def library_recipes():
-                   '--disable-dependency-tracking',
-               ]
-           ),
--        ])
--
--    if getDeptargetTuple() < (10, 5):
--        result.extend([
-           dict(
--              name="Bzip2 1.0.6",
--              url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz",
--              checksum='00b516f4704d4a7cb50a1d97e6e8e15b',
-+              name="Bzip2 1.0.8",
-+              url="https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
-+              checksum='67e051268d0c475ea773822f7500d0e5',
-               configure=None,
-               install='make install CC=%s CXX=%s, PREFIX=%s/usr/local/ CFLAGS="-arch %s"'%(
-                   CC, CXX,
-                   shellQuote(os.path.join(WORKDIR, 'libraries')),
-                   ' -arch '.join(ARCHLIST),
--              ),
-+              )
-           ),
-           dict(
--              name="ZLib 1.2.3",
--              url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
--              checksum='debc62758716a169df9f62e6ab2bc634',
--              configure=None,
--              install='make install CC=%s CXX=%s, prefix=%s/usr/local/ CFLAGS="-arch %s"'%(
--                  CC, CXX,
--                  shellQuote(os.path.join(WORKDIR, 'libraries')),
--                  ' -arch '.join(ARCHLIST),
--              ),
--          ),
-+              name="ZLib 1.2.12",
-+              url="https://zlib.net/zlib-1.2.12.tar.gz",
-+              checksum='5fc414a9726be31427b440b434d05f78',
-+              suppressCFlags=True,
-+              configure='./configure',
-+              configure_full=[
-+                  '--prefix=%s/usr/local/' % (os.path.join(WORKDIR, 'libraries'))
-+              ],
-+              install='make install'
-+            ),
-+    ])
-+
-+    if getDeptargetTuple() < (10, 5):
-+        result.extend([
-           dict(
-               # Note that GNU readline is GPL'd software
-               name="GNU Readline 6.1.2",
-@@ -980,7 +978,10 @@ def buildRecipe(recipe, basedir, archList):
-             #"CPP=gcc -arch %s -E"%(' -arch '.join(archList,),),
-         ]
-
--        if 'configure_pre' in recipe:
-+        if 'configure_full' in recipe:
-+            configure_args = list(recipe['configure_full'])
-+
-+        elif 'configure_pre' in recipe:
-             args = list(recipe['configure_pre'])
-             if '--disable-static' in args:
-                 configure_args.remove('--enable-static')
-@@ -988,28 +989,29 @@ def buildRecipe(recipe, basedir, archList):
+@@ -1005,19 +1006,29 @@ def buildRecipe(recipe, basedir, archList):
                  configure_args.remove('--disable-shared')
              configure_args.extend(args)
-
+ 
 -        if recipe.get('useLDFlags', 1):
 -            configure_args.extend([
 -                "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
@@ -155,15 +55,6 @@ index 4fab488..2f1bd81 100755
 -                    shellQuote(basedir)[1:-1],
 -                    ' -arch '.join(archList)),
 -            ])
--        else:
--            configure_args.extend([
--                "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
--                            "-I%s/usr/local/include"%(
--                        recipe.get('extra_cflags', ''),
--                        DEPTARGET,
--                        ' -arch '.join(archList),
--                        shellQuote(basedir)[1:-1],),
--            ])
 +                        shellQuote(basedir)[1:-1],
 +                        ' -arch '.join(archList)),
 +                ])
@@ -176,26 +67,18 @@ index 4fab488..2f1bd81 100755
 +                            ' -arch '.join(archList),
 +                            shellQuote(basedir)[1:-1],),
 +                ])
-
-         if 'configure_post' in recipe:
-             configure_args = configure_args + list(recipe['configure_post'])
-@@ -1090,6 +1092,8 @@ def buildPythonDocs():
-     if not os.path.exists(htmlDir):
-         # Create virtual environment for docs builds with blurb and sphinx
-         runCommand('make venv')
-+        runCommand('venv/bin/python3 -m pip install -U markupsafe==2.0.1')
-+        runCommand('venv/bin/python3 -m pip install -U jinja2==2.11.3')
-         runCommand('venv/bin/python3 -m pip install -U Sphinx==2.3.1')
-         runCommand('make html PYTHON=venv/bin/python')
-     os.rename(htmlDir, docdir)
-@@ -1522,6 +1524,11 @@ def buildInstaller():
+         else:
+             configure_args.extend([
+                 "CFLAGS=%s-mmacosx-version-min=%s -arch %s "
+@@ -1540,8 +1551,9 @@ def buildInstaller():
      pkgroot = os.path.join(outdir, 'Python.mpkg', 'Contents')
      pkgcontents = os.path.join(pkgroot, 'Packages')
      os.makedirs(pkgcontents)
+-    for recipe in pkg_recipes():
+-        packageFromRecipe(pkgcontents, recipe)
 +
 +    #o3de modification:  We don't need packages for our purposes, so we return immediately:
 +    return
-+
-+
-     for recipe in pkg_recipes():
-         packageFromRecipe(pkgcontents, recipe)
+ 
+     rsrcDir = os.path.join(pkgroot, 'Resources')
+ 

+ 1 - 1
package-system/python/linux_x64/FindPython.cmake

@@ -8,4 +8,4 @@
 
 # force this into config mode, so that it uses the config files instead of module files.
 set(Python_DIR ${CMAKE_CURRENT_LIST_DIR})
-find_package(Python 3.7.12 REQUIRED CONFIG)
+find_package(Python 3.10.5 REQUIRED CONFIG)

+ 1 - 1
package-system/python/linux_x64/PackageInfo.json

@@ -1,5 +1,5 @@
 {
-    "PackageName" : "python-3.7.12-rev2-linux",
+    "PackageName" : "python-3.10.5-rev2-linux",
     "License"     : "PSF-2.0",
     "URL"         : "https://python.org",
     "LicenseFile" : "python/LICENSE"

+ 64 - 35
package-system/python/linux_x64/make-python.sh

@@ -47,10 +47,10 @@ mkdir -p temp
 
 
 echo ""
-echo "--------------- Cloning python 3.7.12 from git ---------------"
+echo "--------------- Cloning python 3.10.5 from git ---------------"
 echo ""
 cd temp
-git clone https://github.com/python/cpython.git --branch v3.7.12 --depth 1
+git clone https://github.com/python/cpython.git --branch v3.10.5 --depth 1
 
 if [[ ! -d "cpython" ]]; then
     echo "Was unable to create cpython dir via git clone.  Is git installed?"
@@ -72,60 +72,78 @@ cp -f -v libexpat/expat/lib/*.c cpython/Modules/expat/
 
 
 echo ""
-echo "--------------- Cloning bzip2 1.0.8 and building ---------------"
+echo "--------------- Cloning libffi 3.4.2 and building static version ---------------"
 echo ""
-git clone git://sourceware.org/git/bzip2.git --branch "bzip2-1.0.8" --depth 1
-if [[ ! -d "bzip2" ]]; then
-    echo "Was unable to create bzip2 dir via git clone.  Is git installed?"
+git clone https://github.com/libffi/libffi.git --branch "v3.4.2" --depth 1
+if [[ ! -d "libffi" ]]; then
+    echo "Was unable to create libffi dir via git clone."
     exit 1
 fi
 
-pushd bzip2
+pushd libffi
 
-PATCH_FILE=$SCRIPT_DIR/open3d_bzip2.patch
-echo Applying patch file $PATCH_FILE
-git apply --ignore-whitespace $PATCH_FILE
+# According to the README.md for libffi, we need to run autogen.sh first
+./autogen.sh
+retVal=$?
 if [ $retVal -ne 0 ]; then
-    echo "Git apply failed"
+    echo "Error running autogen.sh for libffi"
+    exit $retVal
+fi
+ 
+./configure --prefix=$SCRIPT_DIR/temp/ffi_lib --enable-shared=no CFLAGS='-fPIC' CPPFLAGS='-fPIC'
+retVal=$?
+if [ $retVal -ne 0 ]; then
+    echo "Error running configuring for libffi"
     exit $retVal
 fi
 
-make bzip2
-
-make install PREFIX=install
+make install
+retVal=$?
+if [ $retVal -ne 0 ]; then
+    echo "Error building libffi"
+    exit $retVal
+fi
 
 popd
 
+
 echo ""
-echo "--------------- Cloning libffi 1.0.8 and building static version ---------------"
+echo "--------------- Cloning openssl 1.1.1q and building it externally ---------------"
 echo ""
-git clone https://github.com/libffi/libffi.git --branch "v3.4.2" --depth 1
-if [[ ! -d "libffi" ]]; then
-    echo "Was unable to create libffi dir via git clone."
+git clone https://github.com/openssl/openssl.git --branch "OpenSSL_1_1_1q" --depth 1
+if [[ ! -d "openssl" ]]; then
+    echo "Was unable to create openssl dir via git clone."
     exit 1
 fi
 
-pushd libffi
+pushd openssl
+
+echo ./config --prefix=$SCRIPT_DIR/temp/openssl-local/build --openssldir=/etc/ssl LDFLAGS='-Wl,-rpath=\$$ORIGIN'
+./config --prefix=$SCRIPT_DIR/temp/openssl-local/build --openssldir=/etc/ssl LDFLAGS='-Wl,-rpath=\$$ORIGIN'
 
-# According to the README.md for libffi, we need to run autogen.sh first
-./autogen.sh
 retVal=$?
 if [ $retVal -ne 0 ]; then
-    echo "Error running autogen.sh for libffi"
+    echo "Error building openssl"
     exit $retVal
 fi
- 
-./configure --prefix=$SCRIPT_DIR/temp/ffi_lib --enable-shared=no --with-fpic=yes CFLAGS='-fPIC' CPPFLAGS='-fPIC'
-retVal=$?
+
+echo make
+make
 if [ $retVal -ne 0 ]; then
-    echo "Error running configuring for libffi"
+    echo "Error building openssl (build failure)"
     exit $retVal
 fi
 
+echo make test
+if [ $retVal -ne 0 ]; then
+    echo "Error building openssl (test failure)"
+    exit $retVal
+fi
+
+echo make install
 make install
-retVal=$?
 if [ $retVal -ne 0 ]; then
-    echo "Error building libffi"
+    echo "Error building openssl (install failure)"
     exit $retVal
 fi
 
@@ -139,7 +157,7 @@ echo "--------------- Building cpython from source ---------------"
 echo ""
 
 # Build from the source with optimizations and shared libs enabled , and override the RPATH and bzip include/lib paths
-./configure --prefix=$SCRIPT_DIR/package/python --enable-optimizations --enable-shared LDFLAGS='-Wl,-rpath=\$$ORIGIN:\$$ORIGIN/../lib:\$$ORIGIN/../.. -L../bzip2/install/lib -L../ffi_lib/lib' CPPFLAGS='-I../bzip2/install/include -I../ffi_lib/include' CFLAGS='-I../temp/bzip2/install/include -I../ffi_lib/include'
+./configure --prefix=$SCRIPT_DIR/package/python --enable-optimizations --with-openssl=$SCRIPT_DIR/temp/openssl-local/build --enable-shared LDFLAGS='-Wl,-rpath=\$$ORIGIN:\$$ORIGIN/../lib:\$$ORIGIN/../.. -L../ffi_lib/lib' CPPFLAGS='-I../ffi_lib/include' CFLAGS='-I../ffi_lib/include' 
 retVal=$?
 if [ $retVal -ne 0 ]; then
     echo "Error running configuring optimized build"
@@ -156,7 +174,7 @@ fi
 # Prepare the package folder
 cd $SCRIPT_DIR
 
-# Install the newly built python 3.7.12 to the package/python folder
+# Install the newly built python 3.10.5 to the package/python folder
 cd $SCRIPT_DIR
 cd temp
 cd cpython
@@ -168,6 +186,7 @@ if [ $retVal -ne 0 ]; then
     exit $retVal
 fi
 
+
 cd $SCRIPT_DIR
 mkdir -p package
 cd package
@@ -180,6 +199,19 @@ cd $SCRIPT_DIR/package/python/bin
 ln -s python3 python
 cd $SCRIPT_DIR/package
 
+
+# Move the openssl libraries to the local cpython build for portability
+pushd $SCRIPT_DIR/package/python/lib
+cp $SCRIPT_DIR/temp/openssl-local/build/lib/libssl.so.1.1 .
+ln -s libssl.so.1.1 libssl.so.1
+cp $SCRIPT_DIR/temp/openssl-local/build/lib/libcrypto.so.1.1 .
+ln -s libcrypto.so.1.1 libcrypto.so.1
+popd
+
+# Copy the openssl license
+cp $SCRIPT_DIR/temp/openssl/LICENSE $SCRIPT_DIR/package/python/LICENSE.OPENSSL
+
+
 echo ""
 echo "--------------- Upgrading pip ---------------"
 echo ""
@@ -211,15 +243,12 @@ rm -v $SCRIPT_DIR/package/python/lib/python3.7/distutils/command/wininst-*.exe
 echo "Removing out of date pip*.whl"
 rm -v $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/_bundled/pip-*.whl
 
-echo "Removing pip references from ensurepip"
-cat $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/__init__.py | sed 's/"20.1.1"/"22.0.3"/g' | sed 's/("pip", _PIP_VERSION, "py2.py3"),//g' > $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/__init__.py_temp
-rm $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/__init__.py
-mv $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/__init__.py_temp $SCRIPT_DIR/package/python/lib/python3.7/ensurepip/__init__.py
-
 echo ""
 echo "--------------- PYTHON WAS BUILT FROM SOURCE ---------------"
 echo ""
 
+
+
 echo "Package has completed building, and is now in $SCRIPT_DIR/package"
 
 if [[ ${PACKAGE_CLEAR_TEMP_FOLDERS} -gt 0 ]]

+ 3 - 3
package-system/python/linux_x64/python-config-version.cmake

@@ -9,7 +9,7 @@
 # this file is called to make sure that if we request a specific version
 # we respond only to that version
 
-set(PACKAGE_VERSION 3.7.12)
+set(PACKAGE_VERSION 3.10.5)
 set(PACKAGE_VERSION_EXACT False)
 set(PACKAGE_VERSION_COMPATIBLE False)
 
@@ -21,11 +21,11 @@ if (PACKAGE_FIND_VERSION_COUNT GREATER 0 AND NOT PACKAGE_FIND_VERSION_MAJOR EQUA
     return()
 endif()
 
-if (PACKAGE_FIND_VERSION_COUNT GREATER 1 AND NOT PACKAGE_FIND_VERSION_MINOR EQUAL 7)
+if (PACKAGE_FIND_VERSION_COUNT GREATER 1 AND NOT PACKAGE_FIND_VERSION_MINOR EQUAL 10)
     return()
 endif()
 
-if (PACKAGE_FIND_VERSION_COUNT GREATER 2 AND NOT PACKAGE_FIND_VERSION_PATCH EQUAL 12)
+if (PACKAGE_FIND_VERSION_COUNT GREATER 2 AND NOT PACKAGE_FIND_VERSION_PATCH EQUAL 5)
     return()
 endif()
 

+ 9 - 9
package-system/python/linux_x64/python-config.cmake

@@ -24,14 +24,14 @@ endif()
 # Python_Development_FOUND - The platform we are cross compiling for can link to python
 # and a target called 3rdParty::Python that you can use to depend on
 
-set(${MY}_VERSION 3.7.12)
+set(${MY}_VERSION 3.10.5)
 set(${MY}_INTERPRETER_ID    "Python")
 set(${MY}_EXECUTABLE        ${CMAKE_CURRENT_LIST_DIR}/python/bin/python)
 set(${MY}_HOME              ${CMAKE_CURRENT_LIST_DIR}/python)
 set(${MY}_PATHS             ${CMAKE_CURRENT_LIST_DIR}/python/lib
-                            ${CMAKE_CURRENT_LIST_DIR}/python/lib/python3.7
-                            ${CMAKE_CURRENT_LIST_DIR}/python/lib/python3.7/lib-dynload
-                            ${CMAKE_CURRENT_LIST_DIR}/python/lib/python3.7/site-packages) 
+                            ${CMAKE_CURRENT_LIST_DIR}/python/lib/python3.10
+                            ${CMAKE_CURRENT_LIST_DIR}/python/lib/python3.10/lib-dynload
+                            ${CMAKE_CURRENT_LIST_DIR}/python/lib/python3.10/site-packages) 
 
 # only if we're compiling FOR on one of the available platforms, add the target and libraries:
 if (${PAL_PLATFORM_NAME} STREQUAL "Linux" )
@@ -46,12 +46,12 @@ if (${PAL_PLATFORM_NAME} STREQUAL "Linux" )
     # also, because the regular .so is a symlink, we actually skip that and link
     # to the real one, so that there's no conflict between what library we copy
     # and what library we link to.
-    set(${MY}_LIBRARY_DEBUG   ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.7m.so.1.0)
-    set(${MY}_LIBRARY_RELEASE ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.7m.so.1.0)
-    set(${MY}_INCLUDE_DIR     ${CMAKE_CURRENT_LIST_DIR}/python/include/python3.7m)
+    set(${MY}_LIBRARY_DEBUG   ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.10.so.1.0)
+    set(${MY}_LIBRARY_RELEASE ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.10.so.1.0)
+    set(${MY}_INCLUDE_DIR     ${CMAKE_CURRENT_LIST_DIR}/python/include/python3.10)
     # DYLIBS causes things to be copied to the bin folder to satisfy RPATH origin
-    set(${MY}_DYLIBS_DEBUG    ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.7m.so.1.0)
-    set(${MY}_DYLIBS_RELEASE  ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.7m.so.1.0)
+    set(${MY}_DYLIBS_DEBUG    ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.10.so.1.0)
+    set(${MY}_DYLIBS_RELEASE  ${CMAKE_CURRENT_LIST_DIR}/python/lib/libpython3.10.so.1.0)
 
     set(${MY}_COMPILE_DEFINITIONS DEFAULT_LY_PYTHONHOME="${CMAKE_CURRENT_LIST_DIR}/python")
 

+ 1 - 1
package-system/python/win_x64/FindPython.cmake

@@ -8,4 +8,4 @@
 
 # force this into config mode, so that it uses the config files instead of module files.
 set(Python_DIR ${CMAKE_CURRENT_LIST_DIR})
-find_package(Python 3.7.12 REQUIRED CONFIG)
+find_package(Python 3.10.5 REQUIRED CONFIG)

+ 1 - 1
package-system/python/win_x64/PackageInfo.json

@@ -1,5 +1,5 @@
 {
-    "PackageName" : "python-3.7.12-rev2-windows",
+    "PackageName" : "python-3.10.5-rev1-windows",
     "URL"         : "https://python.org",
     "License"     : "PSF-2.0",
     "LicenseFile" : "python/LICENSE.txt"

+ 16 - 7
package-system/python/win_x64/build_python.bat

@@ -29,7 +29,7 @@ set vswhere_location=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer
 echo adding %vswhere_location% to PATH
 set PATH=%vswhere_location%;%PATH%
 
-for /f "tokens=*" %%i in ('vswhere -property installationPath') do set VS2017_LOCATION=%%i
+for /f "tokens=*" %%i in ('vswhere -version [15.0^,16.0^) -property installationPath') do set VS2017_LOCATION=%%i
 
 echo Using Visual Studio: %VS2017_LOCATION%
 
@@ -49,8 +49,8 @@ mkdir %outputdir%
 mkdir %tempdir%
 cd /d %tempdir%
 
-echo Cloning python from git using v3.7.12..
-git clone https://github.com/python/cpython.git --branch "v3.7.12" --depth 1
+echo Cloning python from git using v3.10.5..
+git clone https://github.com/python/cpython.git --branch "v3.10.5" --depth 1
 if %ERRORLEVEL% NEQ 0 (
     echo "Git clone failed"
     exit /B 1
@@ -67,7 +67,11 @@ copy /Y /V libexpat/expat/lib/*.c cpython/Modules/expat/
 
 cd /d %python_src%
 
+
+REM If the patch file 'open3d_python.patch' file exists, then apply the patch
 set patch_file=%ScriptDir%\open3d_python.patch
+IF NOT EXIST %patch_file% goto :skip_patch
+
 echo Applying patch file %patch_file%
 git apply --ignore-whitespace %patch_file%
 if %ERRORLEVEL% NEQ 0 (
@@ -75,6 +79,14 @@ if %ERRORLEVEL% NEQ 0 (
     exit /B 1
 )
 
+:skip_patch
+
+echo Getting python
+
+call .\PCBuild\find_python.bat
+
+set PythonForBuild=%PYTHON%
+
 echo Getting external libraries
 call .\PCBuild\get_externals.bat
 
@@ -106,7 +118,7 @@ if %ERRORLEVEL% NEQ 0 (
 )
 
 cd /d %python_src%
-echo installing PIP... (Based on the cpython v3.7.12)
+echo installing PIP...
 %outputdir%\python\Python.exe  -m ensurepip --root %outputdir%\python --upgrade
 if %ERRORLEVEL% NEQ 0 (
   echo Failed to ensure pip is present.
@@ -115,9 +127,6 @@ if %ERRORLEVEL% NEQ 0 (
 echo upgrading PIP... 
 %outputdir%\python\Python.exe -m pip install --target %outputdir%\python\Lib\site-packages --upgrade pip 
 
-rem Now that PIP is part of the package, remove the wheel file of the pre-upgrade version from the package
-del /F /Q %outputdir%\python\Lib\ensurepip\_bundled\pip-*.whl
-
 echo copying package metadata and cmake files...
 rem But we do add our own few things...
 set ROBOCOPY_OPTIONS=/NJH /NJS /NP /NDL

+ 32 - 156
package-system/python/win_x64/open3d_python.patch

@@ -1,156 +1,32 @@
-diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
-index 94d40b0..fea685b 100644
---- a/Lib/ensurepip/__init__.py
-+++ b/Lib/ensurepip/__init__.py
-@@ -11,11 +11,10 @@ __all__ = ["version", "bootstrap"]
- 
- _SETUPTOOLS_VERSION = "47.1.0"
- 
--_PIP_VERSION = "20.1.1"
-+_PIP_VERSION = "22.0.3"
- 
- _PROJECTS = [
--    ("setuptools", _SETUPTOOLS_VERSION, "py3"),
--    ("pip", _PIP_VERSION, "py2.py3"),
-+    ("setuptools", _SETUPTOOLS_VERSION, "py3")
- ]
- 
- 
-diff --git a/PCbuild/_bz2.vcxproj.filters b/PCbuild/_bz2.vcxproj.filters
-index eac64dd..b3fedcf 100644
---- a/PCbuild/_bz2.vcxproj.filters
-+++ b/PCbuild/_bz2.vcxproj.filters
-@@ -4,10 +4,10 @@
-     <Filter Include="Source Files">
-       <UniqueIdentifier>{f53a859d-dad2-4d5b-ae41-f28d8b571f5a}</UniqueIdentifier>
-     </Filter>
--    <Filter Include="bzip2 1.0.6 Header Files">
-+    <Filter Include="bzip2 1.0.8 Header Files">
-       <UniqueIdentifier>{7e0bed05-ae33-43b7-8797-656455bbb7f3}</UniqueIdentifier>
-     </Filter>
--    <Filter Include="bzip2 1.0.6 Source Files">
-+    <Filter Include="bzip2 1.0.8 Source Files">
-       <UniqueIdentifier>{ed574b89-6983-4cdf-9f98-fe7048d9e89c}</UniqueIdentifier>
-     </Filter>
-   </ItemGroup>
-@@ -16,33 +16,33 @@
-       <Filter>Source Files</Filter>
-     </ClCompile>
-     <ClCompile Include="$(bz2Dir)\blocksort.c">
--      <Filter>bzip2 1.0.6 Source Files</Filter>
-+      <Filter>bzip2 1.0.8 Source Files</Filter>
-     </ClCompile>
-     <ClCompile Include="$(bz2Dir)\bzlib.c">
--      <Filter>bzip2 1.0.6 Source Files</Filter>
-+      <Filter>bzip2 1.0.8 Source Files</Filter>
-     </ClCompile>
-     <ClCompile Include="$(bz2Dir)\compress.c">
--      <Filter>bzip2 1.0.6 Source Files</Filter>
-+      <Filter>bzip2 1.0.8 Source Files</Filter>
-     </ClCompile>
-     <ClCompile Include="$(bz2Dir)\crctable.c">
--      <Filter>bzip2 1.0.6 Source Files</Filter>
-+      <Filter>bzip2 1.0.8 Source Files</Filter>
-     </ClCompile>
-     <ClCompile Include="$(bz2Dir)\decompress.c">
--      <Filter>bzip2 1.0.6 Source Files</Filter>
-+      <Filter>bzip2 1.0.8 Source Files</Filter>
-     </ClCompile>
-     <ClCompile Include="$(bz2Dir)\huffman.c">
--      <Filter>bzip2 1.0.6 Source Files</Filter>
-+      <Filter>bzip2 1.0.8 Source Files</Filter>
-     </ClCompile>
-     <ClCompile Include="$(bz2Dir)\randtable.c">
--      <Filter>bzip2 1.0.6 Source Files</Filter>
-+      <Filter>bzip2 1.0.8 Source Files</Filter>
-     </ClCompile>
-   </ItemGroup>
-   <ItemGroup>
-     <ClInclude Include="$(bz2Dir)\bzlib.h">
--      <Filter>bzip2 1.0.6 Header Files</Filter>
-+      <Filter>bzip2 1.0.8 Header Files</Filter>
-     </ClInclude>
-     <ClInclude Include="$(bz2Dir)\bzlib_private.h">
--      <Filter>bzip2 1.0.6 Header Files</Filter>
-+      <Filter>bzip2 1.0.8 Header Files</Filter>
-     </ClInclude>
-   </ItemGroup>
- </Project>
-diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
-index 38fc275..59d7a73 100644
---- a/PCbuild/get_externals.bat
-+++ b/PCbuild/get_externals.bat
-@@ -48,11 +48,11 @@ if NOT DEFINED PYTHON (
- echo.Fetching external libraries...
- 
- set libraries=
--set libraries=%libraries%                                       bzip2-1.0.6
--if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries%     openssl-1.1.1g
--set libraries=%libraries%                                       sqlite-3.31.1.0
--if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0
--if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0
-+set libraries=%libraries%                                       bzip2-1.0.8
-+if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries%     openssl-1.1.1m
-+set libraries=%libraries%                                       sqlite-3.37.2.0
-+if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.12.0
-+if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.12.0
- if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tix-8.4.3.6
- set libraries=%libraries%                                       xz-5.2.2
- set libraries=%libraries%                                       zlib-1.2.11
-@@ -72,8 +72,8 @@ for %%e in (%libraries%) do (
- echo.Fetching external binaries...
- 
- set binaries=
--if NOT "%IncludeSSL%"=="false"     set binaries=%binaries% openssl-bin-1.1.1g
--if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0
-+if NOT "%IncludeSSL%"=="false"     set binaries=%binaries% openssl-bin-1.1.1m
-+if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.12.0
- if NOT "%IncludeSSLSrc%"=="false"  set binaries=%binaries% nasm-2.11.06
- 
- for %%b in (%binaries%) do (
-diff --git a/PCbuild/python.props b/PCbuild/python.props
-index 1034e7f..df0911a 100644
---- a/PCbuild/python.props
-+++ b/PCbuild/python.props
-@@ -46,11 +46,11 @@
-     <ExternalsDir>$(EXTERNALS_DIR)</ExternalsDir>
-     <ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir>
-     <ExternalsDir Condition="!HasTrailingSlash($(ExternalsDir))">$(ExternalsDir)\</ExternalsDir>
--    <sqlite3Dir>$(ExternalsDir)sqlite-3.31.1.0\</sqlite3Dir>
--    <bz2Dir>$(ExternalsDir)bzip2-1.0.6\</bz2Dir>
-+    <sqlite3Dir>$(ExternalsDir)sqlite-3.37.2.0\</sqlite3Dir>
-+    <bz2Dir>$(ExternalsDir)bzip2-1.0.8\</bz2Dir>
-     <lzmaDir>$(ExternalsDir)xz-5.2.2\</lzmaDir>
--    <opensslDir>$(ExternalsDir)openssl-1.1.1g\</opensslDir>
--    <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1g\$(ArchName)\</opensslOutDir>
-+    <opensslDir>$(ExternalsDir)openssl-1.1.1m\</opensslDir>
-+    <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1m\$(ArchName)\</opensslOutDir>
-     <opensslIncludeDir>$(opensslOutDir)include</opensslIncludeDir>
-     <nasmDir>$(ExternalsDir)\nasm-2.11.06\</nasmDir>
-     <zlibDir>$(ExternalsDir)\zlib-1.2.11\</zlibDir>
-diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
-index 9c521fa..5e57a95 100644
---- a/PCbuild/readme.txt
-+++ b/PCbuild/readme.txt
-@@ -157,7 +157,7 @@ interpreter, but they do implement several major features.  See the
- about getting the source for building these libraries.  The sub-projects
- are:
- _bz2
--    Python wrapper for version 1.0.6 of the libbzip2 compression library
-+    Python wrapper for version 1.0.8 of the libbzip2 compression library
-     Homepage:
-         http://www.bzip.org/
- _lzma
-diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props
-index b185cb7..a901998 100644
---- a/PCbuild/tcltk.props
-+++ b/PCbuild/tcltk.props
-@@ -4,7 +4,7 @@
-   <PropertyGroup>
-     <TclMajorVersion>8</TclMajorVersion>
-     <TclMinorVersion>6</TclMinorVersion>
--    <TclPatchLevel>9</TclPatchLevel>
-+    <TclPatchLevel>12</TclPatchLevel>
-     <TclRevision>0</TclRevision>
-     <TkMajorVersion>$(TclMajorVersion)</TkMajorVersion>
-     <TkMinorVersion>$(TclMinorVersion)</TkMinorVersion>
+diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat
+index d0e4a86..cb7f933 100644
+--- a/PCbuild/find_python.bat
++++ b/PCbuild/find_python.bat
+@@ -31,13 +31,13 @@
+ @if "%_Py_EXTERNALS_DIR%"=="" (set _Py_EXTERNALS_DIR=%~dp0\..\externals)
+ 
+ @rem If we have Python in externals, use that one
+-@if exist "%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe" (set PYTHON="%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe") & (set _Py_Python_Source=found in externals directory) & goto :found
++@if exist "%_Py_EXTERNALS_DIR%\python.3.10.5\tools\python.exe" (set PYTHON="%_Py_EXTERNALS_DIR%\python.3.10.5\tools\python.exe") & (set _Py_Python_Source=found in externals directory) & goto :found
+ 
+ @rem If HOST_PYTHON is recent enough, use that
+ @if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -Ec "import sys; assert sys.version_info[:2] >= (3, 8)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found
+ 
+ @rem If py.exe finds a recent enough version, use that one
+-@for %%p in (3.9 3.8) do @py -%%p -EV >nul 2>&1 && (set PYTHON=py -%%p) && (set _Py_Python_Source=found %%p with py.exe) && goto :found
++@for %%p in (3.10 3.9 3.8) do @py -%%p -EV >nul 2>&1 && (set PYTHON=py -%%p) && (set _Py_Python_Source=found %%p with py.exe) && goto :found
+ 
+ @if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%"
+ @set _Py_NUGET=%NUGET%
+@@ -57,9 +57,9 @@
+     )
+ )
+ @echo Installing Python via nuget...
+-@"%_Py_NUGET%" install pythonx86 -ExcludeVersion -OutputDirectory "%_Py_EXTERNALS_DIR%"
++@"%_Py_NUGET%" install python -Version 3.10.5 -OutputDirectory "%_Py_EXTERNALS_DIR%"
+ @rem Quote it here; it's not quoted later because "py -x.y" wouldn't work
+-@if not errorlevel 1 (set PYTHON="%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe") & (set _Py_Python_Source=found on nuget.org) & goto :found
++@if not errorlevel 1 (set PYTHON="%_Py_EXTERNALS_DIR%\python.3.10.5\tools\python.exe") & (set _Py_Python_Source=found on nuget.org) & goto :found
+ 
+ 
+ @set _Py_Python_Source=

+ 3 - 3
package-system/python/win_x64/python-config-version.cmake

@@ -9,7 +9,7 @@
 # this file is called to make sure that if we request a specific version
 # we respond only to that version
 
-set(PACKAGE_VERSION 3.7.12)
+set(PACKAGE_VERSION 3.10.5)
 set(PACKAGE_VERSION_EXACT False)
 set(PACKAGE_VERSION_COMPATIBLE False)
 
@@ -21,11 +21,11 @@ if (PACKAGE_FIND_VERSION_COUNT GREATER 0 AND NOT PACKAGE_FIND_VERSION_MAJOR EQUA
     return()
 endif()
 
-if (PACKAGE_FIND_VERSION_COUNT GREATER 1 AND NOT PACKAGE_FIND_VERSION_MINOR EQUAL 7)
+if (PACKAGE_FIND_VERSION_COUNT GREATER 1 AND NOT PACKAGE_FIND_VERSION_MINOR EQUAL 10)
     return()
 endif()
 
-if (PACKAGE_FIND_VERSION_COUNT GREATER 2 AND NOT PACKAGE_FIND_VERSION_PATCH EQUAL 12)
+if (PACKAGE_FIND_VERSION_COUNT GREATER 2 AND NOT PACKAGE_FIND_VERSION_PATCH EQUAL 5)
     return()
 endif()
 

+ 7 - 7
package-system/python/win_x64/python-config.cmake

@@ -24,7 +24,7 @@ endif()
 # Python_Development_FOUND - The platform we are cross compiling for can link to python
 # and a target called 3rdParty::Python that you can use to depend on
 
-set(${MY}_VERSION 3.7.12)
+set(${MY}_VERSION 3.10.5)
 set(${MY}_INTERPRETER_ID    "Python")
 set(${MY}_EXECUTABLE        ${CMAKE_CURRENT_LIST_DIR}/python/python.exe)
 set(${MY}_HOME              ${CMAKE_CURRENT_LIST_DIR}/python)
@@ -37,13 +37,13 @@ if (${PAL_PLATFORM_NAME} STREQUAL "Windows" )
     set(${MY}_Development_FOUND TRUE)
     # Do not use these  PYTHON_LIBRARY_* or other variables, instead, use the 
     # target '3rdParty::Python'
-    set(${MY}_LIBRARY_DEBUG   ${CMAKE_CURRENT_LIST_DIR}/python/libs/python37_d.lib)
-    set(${MY}_LIBRARY_RELEASE ${CMAKE_CURRENT_LIST_DIR}/python/libs/python37.lib)
+    set(${MY}_LIBRARY_DEBUG   ${CMAKE_CURRENT_LIST_DIR}/python/libs/python310_d.lib)
+    set(${MY}_LIBRARY_RELEASE ${CMAKE_CURRENT_LIST_DIR}/python/libs/python310.lib)
     set(${MY}_INCLUDE_DIR     ${CMAKE_CURRENT_LIST_DIR}/python/include)
-    set(${MY}_DYLIBS_DEBUG    ${CMAKE_CURRENT_LIST_DIR}/python/python37_d.dll ${CMAKE_CURRENT_LIST_DIR}/python/python3_d.dll
-                              ${CMAKE_CURRENT_LIST_DIR}/python/python37_d.pdb ${CMAKE_CURRENT_LIST_DIR}/python/python3_d.pdb)
-    set(${MY}_DYLIBS_RELEASE  ${CMAKE_CURRENT_LIST_DIR}/python/python37.dll ${CMAKE_CURRENT_LIST_DIR}/python/python3.dll
-                              ${CMAKE_CURRENT_LIST_DIR}/python/python37.pdb ${CMAKE_CURRENT_LIST_DIR}/python/python3.pdb)
+    set(${MY}_DYLIBS_DEBUG    ${CMAKE_CURRENT_LIST_DIR}/python/python310_d.dll ${CMAKE_CURRENT_LIST_DIR}/python/python3_d.dll
+                              ${CMAKE_CURRENT_LIST_DIR}/python/python310_d.pdb ${CMAKE_CURRENT_LIST_DIR}/python/python3_d.pdb)
+    set(${MY}_DYLIBS_RELEASE  ${CMAKE_CURRENT_LIST_DIR}/python/python310.dll ${CMAKE_CURRENT_LIST_DIR}/python/python3.dll
+                              ${CMAKE_CURRENT_LIST_DIR}/python/python310.pdb ${CMAKE_CURRENT_LIST_DIR}/python/python3.pdb)
 
     set(${MY}_COMPILE_DEFINITIONS DEFAULT_LY_PYTHONHOME="${CMAKE_CURRENT_LIST_DIR}/python")
 

+ 2 - 2
package_build_list_host_darwin.json

@@ -38,7 +38,7 @@
         "astc-encoder-3.2-rev5-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Mac --package-root ../../package-system --clean",
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Mac --package-root ../../package-system --clean",
         "azslc-1.7.35-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Mac --package-root ../../package-system --clean",
-        "python-3.7.12-rev3-darwin": "package-system/python/build_package_image.py",
+        "python-3.10.5-rev2-darwin": "package-system/python/build_package_image.py",
         "mcpp-2.7.2_az.2-rev1-mac": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.2-rev1",
         "mikkelsen-1.0.0.4-mac": "package-system/mikkelsen/build_package_image.py --platform mac",
         "mikkelsen-1.0.0.4-ios": "package-system/mikkelsen/build_package_image.py --platform ios",
@@ -77,7 +77,7 @@
         "openimageio-opencolorio-2.3.17-rev3-mac": "package-system/openimageio-opencolorio/temp/package-darwin",
         "tiff-4.2.0.15-rev3-mac": "package-system/tiff-mac",
         "tiff-4.2.0.15-rev3-ios": "package-system/tiff-ios",
-        "python-3.7.12-rev3-darwin": "package-system/python/darwin_x64/package",
+        "python-3.10.5-rev2-darwin": "package-system/python/darwin_x64/package",
         "asn1-0.9.27-rev2-ios": "package-system/asn1-ios",
         "PhysX-4.1.2.29882248-rev5-mac": "package-system/PhysX-mac",
         "PhysX-4.1.2.29882248-rev5-ios": "package-system/PhysX-ios",

+ 2 - 2
package_build_list_host_linux.json

@@ -32,7 +32,7 @@
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Linux --package-root ../../package-system --clean",
         "azslc-1.7.35-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Linux --package-root ../../package-system --clean",
         "tiff-4.2.0.15-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/tiff --platform-name Linux --package-root ../../package-system --clean",
-        "python-3.7.12-rev2-linux": "package-system/python/build_package_image.py",
+        "python-3.10.5-rev2-linux": "package-system/python/build_package_image.py",
         "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen/build_package_image.py",
         "qt-5.15.2-rev8-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Linux --package-root ../../package-system/Qt/temp --clean",
         "zlib-1.2.11-rev5-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/zlib --platform-name Linux --package-root ../../package-system --clean",
@@ -63,7 +63,7 @@
         "DirectXShaderCompilerDxc-1.6.2112-o3de-rev1-linux": "package-system/DirectXShaderCompilerDxc-linux",
         "azslc-1.7.35-rev1-linux": "package-system/azslc-linux",
         "tiff-4.2.0.15-rev3-linux": "package-system/tiff-linux",
-        "python-3.7.12-rev2-linux": "package-system/python/linux_x64/package",
+        "python-3.10.5-rev2-linux": "package-system/python/linux_x64/package",
         "PhysX-4.1.2.29882248-rev5-linux": "package-system/PhysX-linux",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux": "package-system/NvCloth-linux",
         "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen-linux",

+ 2 - 2
package_build_list_host_windows.json

@@ -48,7 +48,7 @@
         "poly2tri-7f0487a-rev1-windows": "package-system/poly2tri/build_package_image.py --platform-name windows",
         "pybind11-2.10.0-rev1-multiplatform": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pybind11 --platform-name multiplatform --package-root ../../package-system/pybind11/temp --clean",
         "pyside2-5.15.2.1-py3.10-rev3-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2 --platform-name Windows --package-root ../../package-system/pyside2/temp --clean",
-        "python-3.7.12-rev2-windows": "package-system/python/build_package_image.py",
+        "python-3.10.5-rev1-windows": "package-system/python/build_package_image.py",
         "qt-5.15.2-rev7-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Qt --platform-name Windows --package-root ../../package-system/Qt/temp --clean",
         "RapidJSON-1.1.0-rev1-multiplatform": "Scripts/extras/pull_and_build_from_git.py ../../package-system/RapidJSON --platform-name multiplatform --package-root ../../package-system",
         "SPIRVCross-2021.04.29-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Windows --package-root ../../package-system --clean",
@@ -115,7 +115,7 @@
     "PVRTexTool-4.24.0-rev4-multiplatform": "package-system/PVRTexTool-multiplatform",
     "pybind11-2.10.0-rev1-multiplatform": "package-system/pybind11/temp/pybind11-multiplatform",
     "pyside2-5.15.2.1-py3.10-rev3-windows": "package-system/pyside2/temp/pyside2-windows",
-    "python-3.7.12-rev2-windows": "package-system/python/win_x64/package",
+    "python-3.10.5-rev1-windows": "package-system/python/win_x64/package",
     "qt-5.15.2-rev7-windows": "package-system/Qt/temp/qt-windows",
     "RapidJSON-1.1.0-rev1-multiplatform": "package-system/RapidJSON-multiplatform",
     "RapidXML-1.13-rev1-multiplatform": "package-system/RapidXML-multiplatform",