Skip to content

Commit 3943920

Browse files
authored
Bump Ruff to 0.8.0 (#949)
Hi! I just released Ruff 0.8.0. This release removes a few rules that had been deprecated for a few releases, so Ruff 0.8.0 would have started emitting warnings when linting `scikit-build-core` due to the fact that you have some of these now-removed rules explicitly ignored in your Ruff config. This PR gets rid of the removed rules from your Ruff config. There's also some additional changes made here due to some rule stabilisations in this release -- let me know if these are unwelcome, and I can add them to the `tool.ruff.lint.ignore` list: - Several files have had minor changes made due to the stabilisations of [`unsorted-dunder-all`](https://docs.astral.sh/ruff/rules/unsorted-dunder-all/) (`RUF022`) and [`unsorted-dunder-slots`](https://docs.astral.sh/ruff/rules/unsorted-dunder-slots/) (`RUF023`) - `src/scikit_build_core/builder/get_requires.py` has been changed slightly due to the stabilisation of [`parenthesize-chained-operators`](https://docs.astral.sh/ruff/rules/parenthesize-chained-operators/) (`RUF021`)
1 parent 6330b42 commit 3943920

File tree

8 files changed

+11
-16
lines changed

8 files changed

+11
-16
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
exclude: "^tests"
2626

2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: v0.7.2
28+
rev: v0.8.0
2929
hooks:
3030
- id: ruff
3131
args: ["--fix", "--show-fixes"]

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,13 @@ extend-select = [
260260
]
261261
ignore = [
262262
"PLE1205", # Format check doesn't work with our custom logger
263-
"PT004", # Incorrect, just usefixtures instead.
264263
"PT013", # It's correct to import classes for typing!
265264
"RUF009", # Too easy to get a false positive
266265
"PYI025", # Wants Set to be renamed AbstractSet
267266
"ISC001", # Conflicts with formatter
268267
"PLR09", # Too many ...
269268
"PLR2004", # Magic value used in comparison
270269
"PLC0415", # Import should be at top of file
271-
"ANN101", # Missing type annotation for `self` in method
272-
"ANN102", # Missing type annotation for `cls` in classmethod
273270
"ANN401", # Disallow dynamically typed expressions
274271
"S101", # Use of assert detected
275272
"S603", # subprocess untrusted input

src/scikit_build_core/_compat/importlib/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
else:
2222
from importlib.metadata import EntryPoints
2323

24-
__all__ = ["entry_points", "PathDistribution", "version"]
24+
__all__ = ["PathDistribution", "entry_points", "version"]
2525

2626

2727
def entry_points(*, group: str) -> EntryPoints:

src/scikit_build_core/_logging.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
from . import __version__
2424

2525
__all__ = [
26+
"LEVEL_VALUE",
2627
"ScikitBuildLogger",
28+
"Style",
2729
"logger",
2830
"raw_logger",
31+
"rich_error",
2932
"rich_print",
3033
"rich_warning",
31-
"rich_error",
32-
"LEVEL_VALUE",
33-
"Style",
3434
]
3535

3636

src/scikit_build_core/ast/ast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
if TYPE_CHECKING:
1212
from collections.abc import Generator
1313

14-
__all__ = ["Node", "Block", "parse"]
14+
__all__ = ["Block", "Node", "parse"]
1515

1616

1717
def __dir__() -> list[str]:
@@ -20,7 +20,7 @@ def __dir__() -> list[str]:
2020

2121
@dataclasses.dataclass(frozen=True)
2222
class Node:
23-
__slots__ = ("name", "value", "start", "stop")
23+
__slots__ = ("name", "start", "stop", "value")
2424

2525
name: str
2626
value: str

src/scikit_build_core/ast/tokenizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TokenType(enum.Enum):
4545

4646
@dataclasses.dataclass(frozen=True)
4747
class Token:
48-
__slots__ = ("type", "start", "stop", "value")
48+
__slots__ = ("start", "stop", "type", "value")
4949

5050
type: TokenType
5151
start: int

src/scikit_build_core/build/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ def prepare_metadata_for_build_editable(
110110
).wheel_filename # actually returns the dist-info directory
111111

112112
__all__ += [
113-
"prepare_metadata_for_build_wheel",
114113
"prepare_metadata_for_build_editable",
114+
"prepare_metadata_for_build_wheel",
115115
]
116116

117117

src/scikit_build_core/builder/get_requires.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,8 @@ def ninja(self) -> Generator[str, None, None]:
103103
return
104104

105105
# On Windows MSVC, Ninja is not default
106-
if (
107-
self.settings.fail
108-
or sysconfig.get_platform().startswith("win")
109-
and use_ninja is None
106+
if self.settings.fail or (
107+
sysconfig.get_platform().startswith("win") and use_ninja is None
110108
):
111109
return
112110

0 commit comments

Comments
 (0)