diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d83eef..1bb463d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.12 + rev: v0.15.20 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] @@ -19,7 +19,7 @@ repos: args: [--fail-under=24, localpost] - repo: https://github.com/crate-ci/typos - rev: v1.46.1 + rev: v1 hooks: - id: typos @@ -40,7 +40,7 @@ repos: - id: validate-pyproject - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.11.13 + rev: 0.11.26 hooks: - id: uv-lock diff --git a/localpost/_utils.py b/localpost/_utils.py index 1fe3f5b..132518a 100644 --- a/localpost/_utils.py +++ b/localpost/_utils.py @@ -202,10 +202,10 @@ def ensure_td(value: timedelta | str, /) -> timedelta: try: import pytimeparse2 # noqa: PLC0415 - use_dateutil = pytimeparse2.HAS_RELITIVE_TIMEDELTA + use_dateutil = pytimeparse2.HAS_RELATIVE_TIMEDELTA try: # Make sure to get timedelta, not relativedelta from dateutil - pytimeparse2.HAS_RELITIVE_TIMEDELTA = False + pytimeparse2.HAS_RELATIVE_TIMEDELTA = False # ``as_timedelta=True`` makes ``parse`` return ``timedelta`` # exclusively, but the stubs still expose ``int | float | timedelta``. result = cast("timedelta | None", pytimeparse2.parse(value, as_timedelta=True)) @@ -213,7 +213,7 @@ def ensure_td(value: timedelta | str, /) -> timedelta: raise ValueError(f"Invalid time period: {value!r}") return result finally: - pytimeparse2.HAS_RELITIVE_TIMEDELTA = use_dateutil + pytimeparse2.HAS_RELATIVE_TIMEDELTA = use_dateutil except ImportError: raise ValueError("pytimeparse2 package is required to parse a time period string") from None raise ValueError(f"Invalid time period: {value!r}")