From 5b80f19d01cbc46a09065f516aa9fe73084c6ce1 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 30 Oct 2024 14:13:44 +0100 Subject: [PATCH 1/3] Changes in preparation for Python 3.14 --- makepanda/installer.nsi | 12 ++++++++++++ makepanda/makepandacore.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/makepanda/installer.nsi b/makepanda/installer.nsi index cf6f7746be..b31ad3cd55 100644 --- a/makepanda/installer.nsi +++ b/makepanda/installer.nsi @@ -427,6 +427,7 @@ SectionGroup "Python modules" SecGroupPython !insertmacro PyBindingSection 3.11-32 .cp311-win32.pyd !insertmacro PyBindingSection 3.12-32 .cp312-win32.pyd !insertmacro PyBindingSection 3.13-32 .cp313-win32.pyd + !insertmacro PyBindingSection 3.14-32 .cp314-win32.pyd !else !insertmacro PyBindingSection 3.5 .cp35-win_amd64.pyd !insertmacro PyBindingSection 3.6 .cp36-win_amd64.pyd @@ -437,6 +438,7 @@ SectionGroup "Python modules" SecGroupPython !insertmacro PyBindingSection 3.11 .cp311-win_amd64.pyd !insertmacro PyBindingSection 3.12 .cp312-win_amd64.pyd !insertmacro PyBindingSection 3.13 .cp313-win_amd64.pyd + !insertmacro PyBindingSection 3.14 .cp314-win_amd64.pyd !endif SectionGroupEnd @@ -549,6 +551,7 @@ Function .onInit !insertmacro MaybeEnablePyBindingSection 3.11-32 !insertmacro MaybeEnablePyBindingSection 3.12-32 !insertmacro MaybeEnablePyBindingSection 3.13-32 + !insertmacro MaybeEnablePyBindingSection 3.14-32 ${EndIf} !else !insertmacro MaybeEnablePyBindingSection 3.5 @@ -561,6 +564,7 @@ Function .onInit !insertmacro MaybeEnablePyBindingSection 3.11 !insertmacro MaybeEnablePyBindingSection 3.12 !insertmacro MaybeEnablePyBindingSection 3.13 + !insertmacro MaybeEnablePyBindingSection 3.14 ${EndIf} !endif @@ -586,6 +590,10 @@ Function .onInit SectionSetFlags ${SecPyBindings3.13} ${SF_RO} SectionSetInstTypes ${SecPyBindings3.13} 0 !endif + !ifdef SecPyBindings3.14 + SectionSetFlags ${SecPyBindings3.14} ${SF_RO} + SectionSetInstTypes ${SecPyBindings3.14} 0 + !endif ${EndUnless} FunctionEnd @@ -900,6 +908,7 @@ Section Uninstall !insertmacro RemovePythonPath 3.11-32 !insertmacro RemovePythonPath 3.12-32 !insertmacro RemovePythonPath 3.13-32 + !insertmacro RemovePythonPath 3.14-32 !else !insertmacro RemovePythonPath 3.5 !insertmacro RemovePythonPath 3.6 @@ -910,6 +919,7 @@ Section Uninstall !insertmacro RemovePythonPath 3.11 !insertmacro RemovePythonPath 3.12 !insertmacro RemovePythonPath 3.13 + !insertmacro RemovePythonPath 3.14 !endif SetDetailsPrint both @@ -988,6 +998,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.11-32} $(DESC_SecPyBindings3.11-32) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.12-32} $(DESC_SecPyBindings3.12-32) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.13-32} $(DESC_SecPyBindings3.13-32) + !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.14-32} $(DESC_SecPyBindings3.14-32) !else !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.5} $(DESC_SecPyBindings3.5) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.6} $(DESC_SecPyBindings3.6) @@ -998,6 +1009,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.11} $(DESC_SecPyBindings3.11) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.12} $(DESC_SecPyBindings3.12) !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.13} $(DESC_SecPyBindings3.13) + !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.14} $(DESC_SecPyBindings3.14) !endif !ifdef INCLUDE_PYVER !insertmacro MUI_DESCRIPTION_TEXT ${SecPython} $(DESC_SecPython) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 3e44d65734..74a4307a29 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -2192,7 +2192,7 @@ def SdkLocatePython(prefer_thirdparty_python=False): gil_disabled = locations.get_config_var("Py_GIL_DISABLED") if gil_disabled and int(gil_disabled): - SDK["PYTHONEXEC"] += "3.13t" + SDK["PYTHONEXEC"] += "%d.%dt" % sys.version_info[:2] abiflags = "t" DefSymbol("PYTHON", "Py_GIL_DISABLED", "1") else: From 6010c711c0287a391d41175b3021ce3ebbdec18d Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 30 Oct 2024 14:14:25 +0100 Subject: [PATCH 2/3] tests: Add bin dir to PATH when running FreezeTool test --- tests/dist/test_FreezeTool.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/dist/test_FreezeTool.py b/tests/dist/test_FreezeTool.py index fee7c0a09c..c5414a28d1 100644 --- a/tests/dist/test_FreezeTool.py +++ b/tests/dist/test_FreezeTool.py @@ -108,5 +108,13 @@ def test_Freezer_generateRuntimeFromStub(tmpdir, use_console): # Not supported; see #1348 return - output = subprocess.check_output(target) + env = None + if sys.platform == "win32": + env = dict(os.environ) + if not os.environ.get('PATH'): + env['PATH'] = bin_dir + else: + env['PATH'] = bin_dir + os.pathsep + os.environ['PATH'] + + output = subprocess.check_output(target, env=env) assert output.replace(b'\r\n', b'\n') == b'Module imported\nHello world\n' From 27ce5c991eb79c9bda6de439c0bec8198150fa9c Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 30 Oct 2024 14:57:35 +0100 Subject: [PATCH 3/3] dist: Python 3.13 requires macOS 10.13+ --- direct/src/dist/commands.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index 94ab191d0b..5b325d725c 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -277,9 +277,14 @@ class build_apps(setuptools.Command): elif sys.version_info >= (3, 10): # manylinux1 is not offered for Python 3.10 anymore self.platforms[0] = 'manylinux2010_x86_64' - if sys.version_info >= (3, 8): + + if sys.version_info >= (3, 13): + # This version of Python is only available for 10.13+. + self.platforms[1] = 'macosx_10_13_x86_64' + elif sys.version_info >= (3, 8): # This version of Python is only available for 10.9+. self.platforms[1] = 'macosx_10_9_x86_64' + self.plugins = [] self.embed_prc_data = True self.extra_prc_files = [] @@ -557,14 +562,20 @@ class build_apps(setuptools.Command): subprocess.check_call([sys.executable, '-m', 'pip'] + pip_args) except: # Display a more helpful message for these common issues. - if platform.startswith('manylinux2010_') and sys.version_info >= (3, 11): + if platform.startswith('macosx_10_9_') and sys.version_info >= (3, 13): + new_platform = platform.replace('macosx_10_9_', 'macosx_10_13_') + self.announce('This error likely occurs because {} is not a supported target as of Python 3.13.\nChange the target platform to {} instead.'.format(platform, new_platform), distutils.log.ERROR) + elif platform.startswith('manylinux2010_') and sys.version_info >= (3, 11): new_platform = platform.replace('manylinux2010_', 'manylinux2014_') self.announce('This error likely occurs because {} is not a supported target as of Python 3.11.\nChange the target platform to {} instead.'.format(platform, new_platform), distutils.log.ERROR) elif platform.startswith('manylinux1_') and sys.version_info >= (3, 10): new_platform = platform.replace('manylinux1_', 'manylinux2014_') self.announce('This error likely occurs because {} is not a supported target as of Python 3.10.\nChange the target platform to {} instead.'.format(platform, new_platform), distutils.log.ERROR) elif platform.startswith('macosx_10_6_') and sys.version_info >= (3, 8): - new_platform = platform.replace('macosx_10_6_', 'macosx_10_9_') + if sys.version_info >= (3, 13): + new_platform = platform.replace('macosx_10_6_', 'macosx_10_13_') + else: + new_platform = platform.replace('macosx_10_6_', 'macosx_10_9_') self.announce('This error likely occurs because {} is not a supported target as of Python 3.8.\nChange the target platform to {} instead.'.format(platform, new_platform), distutils.log.ERROR) raise