From 84fdadfbcc50d3eaa9f8a64a83505eae17e81560 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 12 Jul 2021 14:56:06 -0400 Subject: [PATCH] chore: update pre-commit hooks --- .pre-commit-config.yaml | 11 ++++++----- tests/test_class.py | 2 +- tests/test_sequences_and_iterators.py | 4 ++-- tests/test_stl.py | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f5a5723c..4ce9cff57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.0.1 hooks: - id: check-added-large-files - id: check-case-conflict @@ -32,7 +32,7 @@ repos: # Black, the code formatter, natively supports pre-commit - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 21.6b0 hooks: - id: black # By default, this ignores pyi files, though black supports them @@ -41,13 +41,13 @@ repos: # Changes tabs to spaces - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.1.9 + rev: v1.1.10 hooks: - id: remove-tabs # Flake8 also supports pre-commit natively (same author) - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.2 hooks: - id: flake8 additional_dependencies: [flake8-bugbear, pep8-naming] @@ -64,7 +64,7 @@ repos: # Check static types with mypy - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.800 + rev: v0.910 hooks: - id: mypy # The default Python type ignores .pyi files, so let's rerun if detected @@ -72,6 +72,7 @@ repos: files: ^pybind11.*\.pyi?$ # Running per-file misbehaves a bit, so just run on all files, it's fast pass_filenames: false + additional_dependencies: [typed_ast] # Checks the manifest for missing files (native support) - repo: https://github.com/mgedmin/check-manifest diff --git a/tests/test_class.py b/tests/test_class.py index bdcced964..1ff60fe21 100644 --- a/tests/test_class.py +++ b/tests/test_class.py @@ -321,7 +321,7 @@ def test_bind_protected_functions(): def test_brace_initialization(): - """ Tests that simple POD classes can be constructed using C++11 brace initialization """ + """Tests that simple POD classes can be constructed using C++11 brace initialization""" a = m.BraceInitialization(123, "test") assert a.field1 == 123 assert a.field2 == "test" diff --git a/tests/test_sequences_and_iterators.py b/tests/test_sequences_and_iterators.py index c3b608c43..70fb697f9 100644 --- a/tests/test_sequences_and_iterators.py +++ b/tests/test_sequences_and_iterators.py @@ -104,7 +104,7 @@ def test_sequence(): def test_sequence_length(): - """#2076: Exception raised by len(arg) should be propagated """ + """#2076: Exception raised by len(arg) should be propagated""" class BadLen(RuntimeError): pass @@ -187,7 +187,7 @@ def test_iterator_passthrough(): def test_iterator_rvp(): - """#388: Can't make iterators via make_iterator() with different r/v policies """ + """#388: Can't make iterators via make_iterator() with different r/v policies""" import pybind11_tests.sequences_and_iterators as m assert list(m.make_iterator_1()) == [1, 2, 3] diff --git a/tests/test_stl.py b/tests/test_stl.py index 5fd3570fa..6f0845904 100644 --- a/tests/test_stl.py +++ b/tests/test_stl.py @@ -278,7 +278,7 @@ def test_array_cast_sequence(): def test_issue_1561(): - """ check fix for issue #1561 """ + """check fix for issue #1561""" bar = m.Issue1561Outer() bar.list = [m.Issue1561Inner("bar")] bar.list