diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5cde91cf0..330c58ae2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,21 +37,21 @@ repos: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: 6.0.0 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 + rev: v3.19.1 hooks: - id: pyupgrade args: [--py310-plus] - repo: https://github.com/psf/black - rev: 24.10.0 + rev: 25.1.0 hooks: - id: black # - id: black-jupyter # Consider adding this - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.9.6 hooks: - id: ruff args: [--fix-only, --show-fixes] # --unsafe-fixes] @@ -63,7 +63,7 @@ repos: additional_dependencies: &flake8_dependencies # These versions need updated manually - flake8==7.1.1 - - flake8-bugbear==24.10.31 + - flake8-bugbear==24.12.12 - flake8-simplify==0.21.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 @@ -71,7 +71,7 @@ repos: - id: yesqa additional_dependencies: *flake8_dependencies - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.1 hooks: - id: codespell types_or: [python, rst, markdown] @@ -79,13 +79,13 @@ repos: files: ^(nx_cugraph|docs)/ args: ["-L thirdparty,coo,COO,numer"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.9.6 hooks: - id: ruff # Don't have strict linting for miscellaneous code args: [--extend-exclude, "benchmarks/,ci/,docs/,notebooks/"] - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.17.0 + rev: v1.17.1 hooks: - id: rapids-dependency-file-generator args: ["--clean"] @@ -126,7 +126,7 @@ repos: - id: sphinx-lint args: ["--enable=all", "--disable=line-too-long"] - repo: https://github.com/rapidsai/pre-commit-hooks - rev: v0.4.0 + rev: v0.6.0 hooks: - id: verify-copyright files: | diff --git a/benchmarks/pytest-based/create_results_summary_page.py b/benchmarks/pytest-based/create_results_summary_page.py index 4651f5c4f..7b96288ea 100644 --- a/benchmarks/pytest-based/create_results_summary_page.py +++ b/benchmarks/pytest-based/create_results_summary_page.py @@ -1,4 +1,4 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. +# Copyright (c) 2024-2025, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -50,8 +50,7 @@ def get_all_benchmark_info(): name = benchmark_run["name"] algo_name = name.split("[")[0] - if algo_name.startswith("bench_"): - algo_name = algo_name[6:] + algo_name = algo_name.removeprefix("bench_") # special case for betweenness_centrality match = k_patt.match(name) if match is not None: @@ -63,8 +62,7 @@ def get_all_benchmark_info(): f"benchmark name {name} in file {json_file} has an unexpected format" ) dataset = match.group(1) - if dataset.endswith("-backend"): - dataset = dataset[:-8] + dataset = dataset.removesuffix("-backend") match = backend_patt.match(name) if match is None: diff --git a/pyproject.toml b/pyproject.toml index 5c0a55afd..240843370 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -184,6 +184,8 @@ ignore = [ # "TRY004", # Prefer `TypeError` exception for invalid type (Note: good advice, but not worth the nuisance) "B020", # Found for loop that reassigns the iterable it is iterating with each iterable value (too strict) "B904", # Bare `raise` inside exception clause (like TRY200; sometimes okay) + "RUF021", # parenthesize-chained-operators (Note: use our judgement for what is more clear) + "RUF022", # unsorted-dunder-all (Note: probably okay, but noisy) "S310", # Audit URL open for permitted schemes (Note: we don't download URLs in normal usage) # Intentionally ignored