Skip to content

Commit

Permalink
CI(deps): Update ruff to v0.8.5 (OSGeo#4906)
Browse files Browse the repository at this point in the history
* CI(deps): Update ruff to v0.8.5

* style: Fix RUF056 [*] Avoid providing a falsy fallback to `dict.get()` in boolean test positions. The default fallback `None` is already falsy.

* style: Fix UP006 Use `collections.abc.Callable` instead of `Callable` for type annotation

* Fix some typos in grass.gunittest.checkers

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
  • Loading branch information
renovate[bot] and echoix authored Jan 2, 2025
1 parent 7e49a2b commit 46d2bac
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions python/grass/gunittest/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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)])
Expand Down
2 changes: 1 addition & 1 deletion python/grass/pygrass/tests/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/grass/script/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 46d2bac

Please sign in to comment.