diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b998fda1..fb3124cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: exclude: "^tests" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.2 + rev: v0.8.0 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/pyproject.toml b/pyproject.toml index 18ca28bd..da240ddf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -260,7 +260,6 @@ extend-select = [ ] ignore = [ "PLE1205", # Format check doesn't work with our custom logger - "PT004", # Incorrect, just usefixtures instead. "PT013", # It's correct to import classes for typing! "RUF009", # Too easy to get a false positive "PYI025", # Wants Set to be renamed AbstractSet @@ -268,8 +267,6 @@ ignore = [ "PLR09", # Too many ... "PLR2004", # Magic value used in comparison "PLC0415", # Import should be at top of file - "ANN101", # Missing type annotation for `self` in method - "ANN102", # Missing type annotation for `cls` in classmethod "ANN401", # Disallow dynamically typed expressions "S101", # Use of assert detected "S603", # subprocess untrusted input diff --git a/src/scikit_build_core/_compat/importlib/metadata.py b/src/scikit_build_core/_compat/importlib/metadata.py index 9e27dc0e..e313a640 100644 --- a/src/scikit_build_core/_compat/importlib/metadata.py +++ b/src/scikit_build_core/_compat/importlib/metadata.py @@ -21,7 +21,7 @@ else: from importlib.metadata import EntryPoints -__all__ = ["entry_points", "PathDistribution", "version"] +__all__ = ["PathDistribution", "entry_points", "version"] def entry_points(*, group: str) -> EntryPoints: diff --git a/src/scikit_build_core/_logging.py b/src/scikit_build_core/_logging.py index 68e69028..c928026c 100644 --- a/src/scikit_build_core/_logging.py +++ b/src/scikit_build_core/_logging.py @@ -23,14 +23,14 @@ from . import __version__ __all__ = [ + "LEVEL_VALUE", "ScikitBuildLogger", + "Style", "logger", "raw_logger", + "rich_error", "rich_print", "rich_warning", - "rich_error", - "LEVEL_VALUE", - "Style", ] diff --git a/src/scikit_build_core/ast/ast.py b/src/scikit_build_core/ast/ast.py index 0c736d87..0e30ae53 100644 --- a/src/scikit_build_core/ast/ast.py +++ b/src/scikit_build_core/ast/ast.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: from collections.abc import Generator -__all__ = ["Node", "Block", "parse"] +__all__ = ["Block", "Node", "parse"] def __dir__() -> list[str]: @@ -20,7 +20,7 @@ def __dir__() -> list[str]: @dataclasses.dataclass(frozen=True) class Node: - __slots__ = ("name", "value", "start", "stop") + __slots__ = ("name", "start", "stop", "value") name: str value: str diff --git a/src/scikit_build_core/ast/tokenizer.py b/src/scikit_build_core/ast/tokenizer.py index 961dcfa5..5740fa87 100644 --- a/src/scikit_build_core/ast/tokenizer.py +++ b/src/scikit_build_core/ast/tokenizer.py @@ -45,7 +45,7 @@ class TokenType(enum.Enum): @dataclasses.dataclass(frozen=True) class Token: - __slots__ = ("type", "start", "stop", "value") + __slots__ = ("start", "stop", "type", "value") type: TokenType start: int diff --git a/src/scikit_build_core/build/__init__.py b/src/scikit_build_core/build/__init__.py index 89f5698c..c3e82c98 100644 --- a/src/scikit_build_core/build/__init__.py +++ b/src/scikit_build_core/build/__init__.py @@ -110,8 +110,8 @@ def prepare_metadata_for_build_editable( ).wheel_filename # actually returns the dist-info directory __all__ += [ - "prepare_metadata_for_build_wheel", "prepare_metadata_for_build_editable", + "prepare_metadata_for_build_wheel", ] diff --git a/src/scikit_build_core/builder/get_requires.py b/src/scikit_build_core/builder/get_requires.py index 4b490b15..9142d888 100644 --- a/src/scikit_build_core/builder/get_requires.py +++ b/src/scikit_build_core/builder/get_requires.py @@ -103,10 +103,8 @@ def ninja(self) -> Generator[str, None, None]: return # On Windows MSVC, Ninja is not default - if ( - self.settings.fail - or sysconfig.get_platform().startswith("win") - and use_ninja is None + if self.settings.fail or ( + sysconfig.get_platform().startswith("win") and use_ninja is None ): return