Godot Engine – Multi-platform 2D and 3D game engine
CI: Bump minimum Python version (3.9 → 3.10)
Thaddeus Crewsd19054c09d91
diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.ymlindex ab38003b86a..52db3fd4a3a 100644--- a/.github/workflows/linux_builds.yml+++ b/.github/workflows/linux_builds.yml@@ -154,7 +154,7 @@ jobs:uses: ./.github/actions/godot-depswith:# Sync with Ensure*Version in SConstruct.- python-version: 3.9+ python-version: "3.10"scons-version: 4.4- name: Force remove preinstalled .NET SDKsdiff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 2d4de89e356..97edad6b062 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -53,7 +53,7 @@ repos:stages: [manual]- repo: https://github.com/astral-sh/ruff-pre-commit- rev: v0.15.20+ rev: v0.17.1hooks:- id: ruff-checkargs: [--color=always]@@ -65,7 +65,7 @@ repos:types_or: [text]- repo: https://github.com/pre-commit/mirrors-mypy- rev: v1.19.1+ rev: v2.4.0hooks:- id: mypyfiles: \.py$diff --git a/SConstruct b/SConstructindex cf4beb08cd7..eebfab8e59b 100644--- a/SConstruct+++ b/SConstruct@@ -2,7 +2,7 @@from misc.utility.scons_hints import *EnsureSConsVersion(4, 4)-EnsurePythonVersion(3, 9)+EnsurePythonVersion(3, 10)# Systemimport globdiff --git a/core/profiling/SCsub b/core/profiling/SCsubindex 94b7eeaaec9..cc635173a60 100644--- a/core/profiling/SCsub+++ b/core/profiling/SCsub@@ -1,5 +1,4 @@#!/usr/bin/env python-from __future__ import annotationsfrom misc.utility.scons_hints import *diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.pyindex 9bc3d062b4b..104e5af209f 100755--- a/doc/tools/doc_status.py+++ b/doc/tools/doc_status.py@@ -1,7 +1,5 @@#!/usr/bin/env python3-from __future__ import annotations-import fnmatchimport mathimport os@@ -138,7 +136,7 @@ class ClassStatusProgress:self.described: int = describedself.total: int = total- def __add__(self, other: ClassStatusProgress):+ def __add__(self, other: "ClassStatusProgress"):return ClassStatusProgress(self.described + other.described, self.total + other.total)def increment(self, described: bool):@@ -189,7 +187,7 @@ class ClassStatus:"constructors": ClassStatusProgress(),}- def __add__(self, other: ClassStatus):+ def __add__(self, other: "ClassStatus"):new_status = ClassStatus()new_status.name = self.namenew_status.has_brief_description = self.has_brief_description and other.has_brief_descriptiondiff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.pyindex 2433024070c..602616b91bd 100755--- a/doc/tools/make_rst.py+++ b/doc/tools/make_rst.py@@ -1,8 +1,6 @@#!/usr/bin/env python3# This script makes RST files from the XML class reference for use with the online docs.-from __future__ import annotations-import argparseimport osimport re@@ -424,7 +422,7 @@ class State:self.current_class = ""- def parse_params(self, root: ET.Element, context: str) -> list[ParameterDef]:+ def parse_params(self, root: ET.Element, context: str) -> list["ParameterDef"]:param_elements = root.findall("param")params: Any = [None] * len(param_elements)@@ -474,7 +472,7 @@ class TypeName:return make_type(self.type_name, state)@classmethod- def from_element(cls, element: ET.Element) -> TypeName:+ def from_element(cls, element: ET.Element) -> "TypeName":return cls(element.attrib["type"], element.get("enum"), element.get("is_bitfield") == "true")diff --git a/methods.py b/methods.pyindex 5e48f4beabf..cb26e65ad06 100644--- a/methods.py+++ b/methods.py@@ -1,5 +1,3 @@-from __future__ import annotations-import atexitimport contextlibimport glob@@ -25,7 +23,7 @@ compiler_version_cache = None# Listing all the folders we have converted# for SCU in scu_builders.py-_scu_folders = set()+_scu_folders = set[str]()def set_scu_folders(scu_folders):diff --git a/misc/scripts/char_range_fetch.py b/misc/scripts/char_range_fetch.pyindex 336d31b6dbe..c231ba94509 100755--- a/misc/scripts/char_range_fetch.py+++ b/misc/scripts/char_range_fetch.py@@ -4,8 +4,6 @@# the Unicode Character Database to the `char_range.cpp` file.# NOTE: This script is deliberately not integrated into the build system;# you should run it manually whenever you want to update the data.-from __future__ import annotations-import osimport sysfrom typing import Finaldiff --git a/misc/scripts/ucaps_fetch.py b/misc/scripts/ucaps_fetch.pyindex 27ed978708f..d20ff7ef54f 100755--- a/misc/scripts/ucaps_fetch.py+++ b/misc/scripts/ucaps_fetch.py@@ -4,8 +4,6 @@# the Unicode Character Database to the `ucaps.h` file.# NOTE: This script is deliberately not integrated into the build system;# you should run it manually whenever you want to update the data.-from __future__ import annotations-import osimport sysfrom typing import Finaldiff --git a/misc/scripts/unicode_ranges_fetch.py b/misc/scripts/unicode_ranges_fetch.pyindex e84ca7545cc..9a5fd2b8a05 100755--- a/misc/scripts/unicode_ranges_fetch.py+++ b/misc/scripts/unicode_ranges_fetch.py@@ -4,8 +4,6 @@# the Unicode Character Database to the `unicode_ranges.inc` file.# NOTE: This script is deliberately not integrated into the build system;# you should run it manually whenever you want to update the data.-from __future__ import annotations-import osimport sysfrom typing import Finaldiff --git a/misc/utility/color.py b/misc/utility/color.pyindex e482b6a776e..ad73b67ea8f 100644--- a/misc/utility/color.py+++ b/misc/utility/color.py@@ -1,5 +1,3 @@-from __future__ import annotations-import osimport reimport sysdiff --git a/modules/mono/build_scripts/build_assemblies.py b/modules/mono/build_scripts/build_assemblies.pyindex ae46efeb765..dfbecbe432e 100755--- a/modules/mono/build_scripts/build_assemblies.py+++ b/modules/mono/build_scripts/build_assemblies.py@@ -1,7 +1,5 @@#!/usr/bin/env python3-from __future__ import annotations-import osimport os.pathimport shlexdiff --git a/modules/raycast/godot_update_embree.py b/modules/raycast/godot_update_embree.pyindex b52613d8385..26e4519318d 100644--- a/modules/raycast/godot_update_embree.py+++ b/modules/raycast/godot_update_embree.py@@ -5,7 +5,8 @@ import shutilimport statimport subprocessimport sys-from typing import Any, Callable+from collections.abc import Callable+from typing import Anygit_tag = "v4.4.0"diff --git a/pyproject.toml b/pyproject.tomlindex a8caa39a1ef..780835e462f 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -10,12 +10,12 @@ warn_redundant_casts = truewarn_return_any = truewarn_unreachable = trueexclude = ["thirdparty/"]-python_version = "3.9"+python_version = "3.10"[tool.ruff]extend-exclude = ["thirdparty"]extend-include = ["*SConstruct", "*SCsub"]-target-version = "py39"+target-version = "py310"line-length = 120preview = truefix = truediff --git a/scu_builders.py b/scu_builders.pyindex 49acbe57409..405a5277b67 100644--- a/scu_builders.py+++ b/scu_builders.py@@ -10,7 +10,7 @@ from methods import print_errorbase_folder_path = str(Path(__file__).parent) + "/"base_folder_only = os.path.basename(os.path.normpath(base_folder_path))_verbose = False # Set manually for debug prints-_scu_folders = set()+_scu_folders = set[str]()_max_includes_per_scu = 1024diff --git a/tests/compatibility_test/run_compatibility_test.py b/tests/compatibility_test/run_compatibility_test.pyindex cb898f63ca2..e130098d523 100755--- a/tests/compatibility_test/run_compatibility_test.py+++ b/tests/compatibility_test/run_compatibility_test.py@@ -1,5 +1,4 @@#!/usr/bin/env python3-from __future__ import annotationsimport itertoolsimport jsondiff --git a/tests/python_build/validate_builders.py b/tests/python_build/validate_builders.pyindex 0986d132e31..7e344af8481 100755--- a/tests/python_build/validate_builders.py+++ b/tests/python_build/validate_builders.py@@ -1,13 +1,12 @@#!/usr/bin/env python3-from __future__ import annotations-if __name__ != "__main__":raise ImportError(f"{__name__} should not be used as a module.")import osimport sys-from typing import Any, Callable+from collections.abc import Callable+from typing import Anysys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../"))