Skip to content

Commit afb1d82

Browse files
committed
Merge pull request godotengine#97237 from Repiteo/style/update-mypy-ruff
Style: Update `ruff` & `mypy` to latest versions
2 parents d39f534 + fdc6ffd commit afb1d82

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ repos:
3939
stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy`
4040

4141
- repo: https://github.com/astral-sh/ruff-pre-commit
42-
rev: v0.4.4
42+
rev: v0.6.6
4343
hooks:
4444
- id: ruff
4545
args: [--fix]
4646
- id: ruff-format
4747

4848
- repo: https://github.com/pre-commit/mirrors-mypy
49-
rev: v0.971
49+
rev: v1.11.2
5050
hooks:
5151
- id: mypy
5252
files: \.py$

modules/raycast/godot_update_embree.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import shutil
55
import stat
66
import subprocess
7-
from types import TracebackType
8-
from typing import Any, Callable, Tuple, Type
7+
import sys
8+
from typing import Any, Callable
99

1010
git_tag = "v4.3.1"
1111

@@ -100,9 +100,7 @@
100100
commit_hash = str(subprocess.check_output(["git", "rev-parse", "HEAD"], universal_newlines=True)).strip()
101101

102102

103-
def on_rm_error(
104-
function: Callable[..., Any], path: str, excinfo: Tuple[Type[Exception], Exception, TracebackType]
105-
) -> None:
103+
def on_rm_error(function: Callable[..., Any], path: str, excinfo: Exception) -> None:
106104
"""
107105
Error handler for `shutil.rmtree()`.
108106
@@ -113,10 +111,12 @@ def on_rm_error(
113111
os.unlink(path)
114112

115113

116-
# 3.12 Python and beyond should replace `onerror` with `onexc`.
117114
# We remove the .git directory because it contains
118115
# a lot of read-only files that are problematic on Windows.
119-
shutil.rmtree(".git", onerror=on_rm_error)
116+
if sys.version_info >= (3, 12):
117+
shutil.rmtree(".git", onexc=on_rm_error)
118+
else:
119+
shutil.rmtree(".git", onerror=on_rm_error) # type: ignore
120120

121121
all_files = set(cpp_files)
122122

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ warn_unreachable = true
1010
namespace_packages = true
1111
explicit_package_bases = true
1212
exclude = ["thirdparty/"]
13+
python_version = "3.8"
1314

1415
[tool.ruff]
1516
extend-exclude = ["thirdparty"]

0 commit comments

Comments
 (0)