diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41bf4aa8..3d2159f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,7 @@ repos: exclude: CHANGELOG.md - repo: https://github.com/JoC0de/pre-commit-prettier - rev: b3e25fa39aa676c36bc18eb9eae6f26d9bb63f39 # v3.6.2 using SHA as tags are not persistent + rev: v3.7.4 hooks: - id: prettier files: \.(json|yml|yaml|toml) @@ -55,7 +55,7 @@ repos: args: ["--print-width=120"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.11 + rev: v0.14.10 hooks: - id: ruff args: ["--fix"] @@ -63,12 +63,12 @@ repos: - id: ruff-check - repo: https://github.com/sphinx-contrib/sphinx-lint - rev: v1.0.0 + rev: v1.0.2 hooks: - id: sphinx-lint - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.6.0 + rev: v2.11.1 hooks: - id: pyproject-fmt additional_dependencies: [tox] diff --git a/tests/unittests/core/test_imports.py b/tests/unittests/core/test_imports.py index 1cb69195..915f82f5 100644 --- a/tests/unittests/core/test_imports.py +++ b/tests/unittests/core/test_imports.py @@ -153,7 +153,7 @@ def my_torch_func(i: int) -> int: def test_torch_func_raised(): with pytest.raises( ModuleNotFoundError, - match="Required dependencies not available: \nModule not found: 'torch.unknown.subpackage'. ", + match=re.escape("Required dependencies not available: \nModule not found: 'torch.unknown.subpackage'. "), ): my_torch_func(42) @@ -181,7 +181,7 @@ def __init__(self): def test_torch_class_raised(): with pytest.raises( - ModuleNotFoundError, match="Required dependencies not available: \nModule not found: 'torch>99.0'." + ModuleNotFoundError, match=re.escape("Required dependencies not available: \nModule not found: 'torch>99.0'.") ): MyTorchClass() diff --git a/tests/unittests/core/test_rank_zero.py b/tests/unittests/core/test_rank_zero.py index 9a51b031..b9e06967 100644 --- a/tests/unittests/core/test_rank_zero.py +++ b/tests/unittests/core/test_rank_zero.py @@ -1,3 +1,5 @@ +import re + import pytest from lightning_utilities.core.rank_zero import rank_prefixed_message, rank_zero_only @@ -5,7 +7,7 @@ def test_rank_zero_only_raises(): foo = rank_zero_only(lambda x: x + 1) - with pytest.raises(RuntimeError, match="rank_zero_only.rank` needs to be set "): + with pytest.raises(RuntimeError, match=re.escape("rank_zero_only.rank` needs to be set ")): foo(1)