Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style: Update ruff & mypy to latest versions #97237

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ repos:
stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy`

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
rev: v0.6.6
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v1.11.2
hooks:
- id: mypy
files: \.py$
Expand Down
14 changes: 7 additions & 7 deletions modules/raycast/godot_update_embree.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import shutil
import stat
import subprocess
from types import TracebackType
from typing import Any, Callable, Tuple, Type
import sys
from typing import Any, Callable

git_tag = "v4.3.1"

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


def on_rm_error(
function: Callable[..., Any], path: str, excinfo: Tuple[Type[Exception], Exception, TracebackType]
) -> None:
def on_rm_error(function: Callable[..., Any], path: str, excinfo: Exception) -> None:
"""
Error handler for `shutil.rmtree()`.

Expand All @@ -113,10 +111,12 @@ def on_rm_error(
os.unlink(path)


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

all_files = set(cpp_files)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ warn_unreachable = true
namespace_packages = true
explicit_package_bases = true
exclude = ["thirdparty/"]
python_version = "3.8"

[tool.ruff]
extend-exclude = ["thirdparty"]
Expand Down
Loading