Skip to content
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@ 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)
# https://prettier.io/docs/en/options.html#print-width
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"]
- id: ruff-format
- 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]
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/core/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()

Expand Down
4 changes: 3 additions & 1 deletion tests/unittests/core/test_rank_zero.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import re

import pytest

from lightning_utilities.core.rank_zero import rank_prefixed_message, rank_zero_only


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)


Expand Down
Loading