From c71148efad7c413c0f4e1389d5528a47e46057e6 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 29 Jun 2024 08:58:30 +0200 Subject: [PATCH] bump linting again --- .pre-commit-config.yaml | 25 +++++++++++++------------ README.md | 2 +- pyproject.toml | 11 ++++++++++- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4256495..c0f8cef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -33,13 +33,13 @@ repos: - id: name-tests-test args: ["--pytest-test-first"] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.16 + rev: v0.18 hooks: - id: validate-pyproject name: Validate pyproject.toml # I don't yet trust ruff to do what autoflake does - repo: https://github.com/PyCQA/autoflake - rev: v2.3.0 + rev: v2.3.1 hooks: - id: autoflake args: [--in-place] @@ -48,32 +48,33 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.15.1 + rev: v3.16.0 hooks: - id: pyupgrade args: [--py310-plus] - repo: https://github.com/MarcoGorelli/auto-walrus - rev: v0.2.2 + rev: 0.3.4 hooks: - id: auto-walrus + additional_dependencies: [tomli] args: [--line-length, "100"] - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.4.2 hooks: - id: black # - id: black-jupyter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.2 + rev: v0.5.0 hooks: - id: ruff args: [--fix-only, --show-fixes] - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==7.0.0 + - flake8==7.1.0 - flake8-bugbear==24.2.6 - flake8-simplify==0.21.0 - repo: https://github.com/asottile/yesqa @@ -82,14 +83,14 @@ repos: - id: yesqa additional_dependencies: *flake8_dependencies - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell types_or: [python, rst, markdown] additional_dependencies: [tomli] files: ^(graphblas_algorithms|docs)/ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.2 + rev: v0.5.0 hooks: - id: ruff # `pyroma` may help keep our package standards up to date if best practices change. @@ -100,6 +101,6 @@ repos: - id: pyroma args: [-n, "10", .] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: no-commit-to-branch # no commit directly to main diff --git a/README.md b/README.md index b761a71..b6c7e1b 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ T5 = nx.k_truss(G2, 5) ``` `G2` is not a `nx.Graph`, but it does have an attribute -`__networkx_plugin__ = "graphblas"`. This tells NetworkX to +`__networkx_backend__ = "graphblas"`. This tells NetworkX to dispatch the k_truss call to graphblas-algorithms. This link connection exists because graphblas-algorithms registers itself as a "networkx.plugin" entry point. diff --git a/pyproject.toml b/pyproject.toml index bbdaef1..110d51f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,9 +61,14 @@ dependencies = [ "python-graphblas >=2023.1.0", ] +# nx < 3.2 [project.entry-points."networkx.plugins"] graphblas = "graphblas_algorithms.interface:Dispatcher" +[project.entry-points."networkx.plugins_info"] +graphblas = "_nx_graphblas:get_info" + +# nx >= 3.2 [project.entry-points."networkx.backends"] graphblas = "graphblas_algorithms.interface:Dispatcher" @@ -202,6 +207,10 @@ ignore = [ "PLE0605", # Invalid format for `__all__`, must be `tuple` or `list` (Note: broken in v0.0.237) # Maybe consider + "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks + "FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups + "S113", # Probable use of requests call without timeout + "SIM103", # Return the condition `bool(mask.reduce(monoid.lor))` directly # "SIM300", # Yoda conditions are discouraged, use ... instead (Note: we're not this picky) # "SIM401", # Use dict.get ... instead of if-else-block (Note: if-else better for coverage and sometimes clearer) # "TRY004", # Prefer `TypeError` exception for invalid type (Note: good advice, but not worth the nuisance) @@ -271,5 +280,5 @@ builtins-ignorelist = ["copyright"] fixture-parentheses = false mark-parentheses = false -[tool.lint.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "numpy"