Skip to content

Commit

Permalink
bump linting again
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknw committed Jun 29, 2024
1 parent 18f2e28 commit c71148e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
25 changes: 13 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -271,5 +280,5 @@ builtins-ignorelist = ["copyright"]
fixture-parentheses = false
mark-parentheses = false

[tool.lint.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "numpy"

0 comments on commit c71148e

Please sign in to comment.