From a3a5b6eaf0255c91241fa10f593600fb0882ef36 Mon Sep 17 00:00:00 2001 From: paulf81 Date: Tue, 11 Feb 2025 16:02:53 -0700 Subject: [PATCH] Update ruff versions (#1063) --- .pre-commit-config.yaml | 2 +- floris/floris_model.py | 2 +- pyproject.toml | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72c92a9df..7f4d4dc60 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.241 + rev: v0.9.6 hooks: - id: ruff diff --git a/floris/floris_model.py b/floris/floris_model.py index edf987081..4bb926688 100644 --- a/floris/floris_model.py +++ b/floris/floris_model.py @@ -1798,7 +1798,7 @@ def merge_floris_models(fmodel_list, reference_wind_height=None): or general solver settings. """ - if not all( type(fm) == FlorisModel for fm in fmodel_list ): + if not all( type(fm) is FlorisModel for fm in fmodel_list ): raise TypeError( "Incompatible input specified. fmodel_list must be a list of FlorisModel objects." ) diff --git a/pyproject.toml b/pyproject.toml index efa2606ca..e39a55af4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ develop = [ "pytest~=8.0", "pytest-benchmark~=5.1", "pre-commit~=4.0", - "ruff~=0.7", + "ruff~=0.9", "isort~=5.0" ] @@ -141,20 +141,20 @@ filterwarnings = [ [tool.ruff] src = ["floris", "tests"] line-length = 100 -target-version = "py310" +target-version = "py313" # See https://github.com/charliermarsh/ruff#supported-rules # for rules included and matching to prefix. -select = ["F", "E", "W", "C4", ] #"T20", "I" +lint.select = ["F", "E", "W", "C4", ] #"T20", "I" # I - isort is not fully implemented in ruff so there is not parity. Consider disabling I. # F401 unused-import: Ignore until all used isort flags are adopted in ruff -ignore = ["F401"] +lint.ignore = ["F401"] # Allow autofix for all enabled rules (when `--fix`) is provided. # fixable = ["A", "B", "C", "D", "E", "F"] -fixable = ["F", "E", "W", "C4"] #"T20", "I" -unfixable = [] +lint.fixable = ["F", "E", "W", "C4"] #"T20", "I" +lint.unfixable = [] # Exclude a variety of commonly ignored directories. exclude = [ @@ -178,12 +178,13 @@ exclude = [ "dist", "node_modules", "venv", + "docs", ] # Allow unused variables when underscore-prefixed. -dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" +lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # F841 unused-variable: ignore since this file uses numexpr and many variables look unused "floris/core/wake_deflection/jimenez.py" = ["F841"] "floris/core/wake_turbulence/crespo_hernandez.py" = ["F841"] @@ -198,7 +199,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" # import dependencies "floris/core/__init__.py" = ["I001"] -[tool.ruff.isort] +[tool.ruff.lint.isort] combine-as-imports = true known-first-party = ["floris"] order-by-type = false