From 076df8e476bf08a26714fc2d55fe44a5eba41dc7 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 5 Nov 2025 17:48:34 -0500 Subject: [PATCH] chore: add a few ruff checks Signed-off-by: Henry Schreiner --- pyproject.toml | 21 ++++++++++++------- .../settings/skbuild_model.py | 2 ++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5cb63069..fd2c67df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -276,21 +276,24 @@ extend-select = [ "UP", # pyupgrade "YTT", # flake8-2020 "FURB", # refurb + "SLOT", # flake8-slots + "DTZ", # flake8-datetimez + "FA", # flake8-future-annotations ] ignore = [ - "PLE1205", # Format check doesn't work with our custom logger - "PT013", # It's correct to import classes for typing! - "RUF009", # Too easy to get a false positive - "PYI025", # Wants Set to be renamed AbstractSet + "ANN401", # Disallow dynamically typed expressions "ISC001", # Conflicts with formatter + "PLC0415", # Import should be at top of file + "PLE1205", # Format check doesn't work with our custom logger "PLR09", # Too many ... "PLR2004", # Magic value used in comparison - "PLC0415", # Import should be at top of file - "ANN401", # Disallow dynamically typed expressions + "PT013", # It's correct to import classes for typing! + "PYI025", # Wants Set to be renamed AbstractSet + "RUF009", # Too easy to get a false positive "S101", # Use of assert detected + "S404", # subprocess module is possibly insecure "S603", # subprocess untrusted input "S607", # subprocess call - "S404", # subprocess module is possibly insecure ] typing-modules = ["scikit_build_core._compat.typing"] @@ -323,9 +326,11 @@ known-local-folder = ["pathutils"] "noxfile.py" = ["T20", "TID251"] "src/scikit_build_core/resources/*.py" = ["PTH", "ARG002", "FBT", "TID251"] "src/scikit_build_core/_compat/**.py" = ["TID251"] -"src/scikit_build_core/settings/**.py" = ["FBT001"] +"src/scikit_build_core/settings/**.py" = ["FBT001", "FA"] +"src/scikit_build_core/file_api/**.py" = ["FA"] "tests/conftest.py" = ["TID251"] "tests/packages/**.py" = ["TID251"] +"tests/test_settings.py" = ["FA"] "docs/conf.py" = ["TID251"] "docs/examples/**" = ["ANN"] "src/scikit_build_core/file_api/model/*.py" = ["N"] diff --git a/src/scikit_build_core/settings/skbuild_model.py b/src/scikit_build_core/settings/skbuild_model.py index a83abd2f..8df218ba 100644 --- a/src/scikit_build_core/settings/skbuild_model.py +++ b/src/scikit_build_core/settings/skbuild_model.py @@ -41,6 +41,8 @@ class CMakeSettingsDefine(str): to the CMake representation in the `cmake.define` settings key. """ + __slots__ = () + json_schema = Union[str, bool, List[str]] def __new__(cls, raw: Union[str, bool, List[str]]) -> "CMakeSettingsDefine":