diff --git a/.github/workflows/python-code-quality.yml b/.github/workflows/python-code-quality.yml index a92a2f5eff5..5308fab7ce6 100644 --- a/.github/workflows/python-code-quality.yml +++ b/.github/workflows/python-code-quality.yml @@ -36,7 +36,7 @@ jobs: # renovate: datasource=pypi depName=bandit BANDIT_VERSION: "1.8.0" # renovate: datasource=pypi depName=ruff - RUFF_VERSION: "0.8.4" + RUFF_VERSION: "0.8.5" runs-on: ${{ matrix.os }} permissions: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5cdc24adf3..a5076c08552 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: ) - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.4 + rev: v0.8.5 hooks: # Run the linter. - id: ruff diff --git a/python/grass/gunittest/checkers.py b/python/grass/gunittest/checkers.py index 1b7f4a069ab..f56511c1b89 100644 --- a/python/grass/gunittest/checkers.py +++ b/python/grass/gunittest/checkers.py @@ -16,12 +16,12 @@ import os import re import sys -from typing import TYPE_CHECKING, Any, Callable +from typing import TYPE_CHECKING, Any from grass.script.utils import encode if TYPE_CHECKING: - from collections.abc import Mapping + from collections.abc import Callable, Mapping try: from grass.script.core import KeyValue @@ -359,8 +359,8 @@ def keyvalue_equals( :param dict_b: second dictionary :param precision: precision with which the floating point values are compared (passed to equality functions) - :param callable def_equal: function used for comparison by default - :param dict key_equal: dictionary of functions used for comparison + :param def_equal: function used for comparison by default + :param key_equal: dictionary of functions used for comparison of specific keys, `def_equal` is used for the rest, keys in dictionary are keys in `dict_a` and `dict_b` dictionaries, values are the functions used to comapare the given key @@ -369,7 +369,7 @@ def keyvalue_equals( :return: `True` if identical, `False` if different - Use `diff_keyvalue()` to get information about differeces. + Use `diff_keyvalue()` to get information about differences. You can use this function to find out if there is a difference and then use `diff_keyvalue()` to determine all the differences between dictionaries. @@ -407,7 +407,7 @@ def diff_keyvalue( (['d'], ['a'], [('c', 2, 1)]) You can provide only a subset of values in dict_a, in this case - first item in tuple is an emptu list:: + first item in tuple is an empty list:: >>> diff_keyvalue(a, b, a_is_subset=True, precision=0) ([], ['a'], [('c', 2, 1)]) diff --git a/python/grass/pygrass/tests/benchmark.py b/python/grass/pygrass/tests/benchmark.py index b6c5e98c26d..f2915ff60d7 100644 --- a/python/grass/pygrass/tests/benchmark.py +++ b/python/grass/pygrass/tests/benchmark.py @@ -385,7 +385,7 @@ class OptionWithDefault(optparse.Option): ATTRS = optparse.Option.ATTRS + [strREQUIRED] def __init__(self, *opts, **attrs): - if attrs.get(strREQUIRED, False): + if attrs.get(strREQUIRED): attrs["help"] = "(Required) " + attrs.get("help", "") optparse.Option.__init__(self, *opts, **attrs) diff --git a/python/grass/script/core.py b/python/grass/script/core.py index 5008d8751f3..a5f41696f34 100644 --- a/python/grass/script/core.py +++ b/python/grass/script/core.py @@ -53,7 +53,7 @@ def __init__(self, args, **kwargs): if ( sys.platform == "win32" and isinstance(args, list) - and not kwargs.get("shell", False) + and not kwargs.get("shell") and kwargs.get("executable") is None ): cmd = shutil.which(args[0])