Skip to content

Commit

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

* style: Ignore PYI066 on non-stub files. Doesn't seem idiomatic and not understood by Pyright.

* style: Fix split-static-string (SIM905)

Ruff rule: https://docs.astral.sh/ruff/rules/split-static-string/

* style: Ignore subclass-builtin (FURB189) in two files, as expected change is not guaranteed to be equivalent

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edouard Choinière <[email protected]>
  • Loading branch information
renovate[bot] and echoix authored Nov 11, 2024
1 parent 8c4f244 commit 66aae0a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 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.7.10"
# renovate: datasource=pypi depName=ruff
RUFF_VERSION: "0.7.2"
RUFF_VERSION: "0.7.3"

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.7.2
rev: v0.7.3
hooks:
# Run the linter.
- id: ruff
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ ignore = [
# "A005", # builtin-module-shadowing
# "PLW0108", # unnecessary-lambda
# Ignore `E402` (import violations) in all `__init__.py` files
"**.py" = ["PYI066"]
"*/testsuite/**.py" = ["PT009", "PT027"]
"__init__.py" = ["E402"]
"display/d.mon/render_cmd.py" = ["SIM115"]
Expand Down Expand Up @@ -317,6 +318,7 @@ ignore = [
"python/grass/pygrass/modules/grid/testsuite/test_*_modules_grid_doctests.py" = ["F401"]
"python/grass/pygrass/modules/interface/env.py" = ["SIM115"]
"python/grass/pygrass/modules/testsuite/test_pygrass_modules_doctests.py" = ["F401"]
"python/grass/pygrass/raster/category.py" = ["FURB189"]
"python/grass/pygrass/raster/segment.py" = ["SIM115"]
"python/grass/pygrass/tests/*.py" = ["SIM115"]
"python/grass/pygrass/vector/geometry.py" = ["PYI024"]
Expand All @@ -326,7 +328,7 @@ ignore = [
"python/grass/script/core.py" = ["SIM115"]
"python/grass/script/db.py" = ["SIM115"]
"python/grass/script/raster.py" = ["SIM115"]
"python/grass/script/utils.py" = ["SIM115"]
"python/grass/script/utils.py" = ["FURB189", "SIM115"]
"python/grass/temporal/aggregation.py" = ["SIM115"]
"python/grass/temporal/register.py" = ["SIM115"]
"python/grass/temporal/stds_export.py" = ["SIM115"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/d.correlate/d.correlate.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def main():

os.environ["GRASS_RENDER_FILE_READ"] = "TRUE"

colors = "red black blue green gray violet".split()
colors = ["red", "black", "blue", "green", "gray", "violet"]
line = 2
iloop = 0
jloop = 0
Expand Down
3 changes: 2 additions & 1 deletion scripts/db.dropcolumn/db.dropcolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def main():
driver=driver,
).split(".")[0:2]

if [int(i) for i in sqlite3_version] >= [int(i) for i in "3.35".split(".")]:
# sqlite version 3.35 compared here
if [int(i) for i in sqlite3_version] >= [int(i) for i in ["3", "35"]]:
sql = "ALTER TABLE %s DROP COLUMN %s" % (table, column)
if column == "cat":
sql = "DROP INDEX %s_%s; %s" % (table, column, sql)
Expand Down

0 comments on commit 66aae0a

Please sign in to comment.