Skip to content

Commit

Permalink
chore(deps): update pre-commit hooks (#5513)
Browse files Browse the repository at this point in the history
* chore(deps): update pre-commit hooks

updates:
- [github.com/pre-commit/mirrors-clang-format: v19.1.6 → v19.1.7](pre-commit/mirrors-clang-format@v19.1.6...v19.1.7)
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.4](astral-sh/ruff-pre-commit@v0.8.6...v0.9.4)
- [github.com/codespell-project/codespell: v2.3.0 → v2.4.1](codespell-project/codespell@v2.3.0...v2.4.1)
- [github.com/PyCQA/pylint: v3.3.3 → v3.3.4](pylint-dev/pylint@v3.3.3...v3.3.4)
- [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.1](python-jsonschema/check-jsonschema@0.30.0...0.31.1)

* style: pre-commit fixes

* Rename `lins` to `lst` in test_pytypes.py to resolve codespell errors:

```
codespell................................................................Failed
- hook id: codespell
- exit code: 65

tests/test_pytypes.py:55: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:56: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:58: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:70: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:71: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:72: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:73: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:74: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:75: lins ==> lines, links, lions, loins, limns
tests/test_pytypes.py:76: lins ==> lines, links, lions, loins, limns
```

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and rwgk authored Feb 4, 2025
1 parent ab44b30 commit d2e7e8c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ repos:

# Clang format the codebase automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v19.1.6"
rev: "v19.1.7"
hooks:
- id: clang-format
types_or: [c++, c, cuda]

# Ruff, the Python auto-correcting linter/formatter written in Rust
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.4
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -119,7 +119,7 @@ repos:
# Use tools/codespell_ignore_lines_from_errors.py
# to rebuild .codespell-ignore-lines
- repo: https://github.com/codespell-project/codespell
rev: "v2.3.0"
rev: "v2.4.1"
hooks:
- id: codespell
exclude: ".supp$"
Expand All @@ -142,14 +142,14 @@ repos:

# PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint
rev: "v3.3.3"
rev: "v3.3.4"
hooks:
- id: pylint
files: ^pybind11

# Check schemas on some of our YAML files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: 0.31.1
hooks:
- id: check-readthedocs
- id: check-github-workflows
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ def pytest_configure():

def pytest_report_header(config):
del config # Unused.
assert (
pybind11_tests.compiler_info is not None
), "Please update pybind11_tests.cpp if this assert fails."
assert pybind11_tests.compiler_info is not None, (
"Please update pybind11_tests.cpp if this assert fails."
)
return (
"C++ Info:"
f" {pybind11_tests.compiler_info}"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_eigen_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ def test_eigen_ref_to_python():
chols = [m.cholesky1, m.cholesky2, m.cholesky3, m.cholesky4]
for i, chol in enumerate(chols, start=1):
mymat = chol(np.array([[1.0, 2, 4], [2, 13, 23], [4, 23, 77]]))
assert np.all(
mymat == np.array([[1, 0, 0], [2, 3, 0], [4, 5, 6]])
), f"cholesky{i}"
assert np.all(mymat == np.array([[1, 0, 0], [2, 3, 0], [4, 5, 6]])), (
f"cholesky{i}"
)


def assign_both(a1, a2, r, c, v):
Expand Down
20 changes: 10 additions & 10 deletions tests/test_pytypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def test_from_iterable(pytype, from_iter_func):

def test_iterable(doc):
assert doc(m.get_iterable) == "get_iterable() -> Iterable"
lins = [1, 2, 3]
i = m.get_first_item_from_iterable(lins)
lst = [1, 2, 3]
i = m.get_first_item_from_iterable(lst)
assert i == 1
i = m.get_second_item_from_iterable(lins)
i = m.get_second_item_from_iterable(lst)
assert i == 2


Expand All @@ -67,13 +67,13 @@ def test_list(capture, doc):
assert m.list_no_args() == []
assert m.list_ssize_t() == []
assert m.list_size_t() == []
lins = [1, 2]
m.list_insert_ssize_t(lins)
assert lins == [1, 83, 2]
m.list_insert_size_t(lins)
assert lins == [1, 83, 2, 57]
m.list_clear(lins)
assert lins == []
lst = [1, 2]
m.list_insert_ssize_t(lst)
assert lst == [1, 83, 2]
m.list_insert_size_t(lst)
assert lst == [1, 83, 2, 57]
m.list_clear(lst)
assert lst == []

with capture:
lst = m.get_list()
Expand Down
5 changes: 2 additions & 3 deletions tests/test_smart_ptr.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,8 @@ def test_smart_ptr_from_default():
instance = m.HeldByDefaultHolder()
with pytest.raises(RuntimeError) as excinfo:
m.HeldByDefaultHolder.load_shared_ptr(instance)
assert (
"Unable to load a custom holder type from a "
"default-holder instance" in str(excinfo.value)
assert "Unable to load a custom holder type from a default-holder instance" in str(
excinfo.value
)


Expand Down

0 comments on commit d2e7e8c

Please sign in to comment.