Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tail_jsonl/_runtime_type_check_setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Conditionally configure runtime typechecking."""

from contextlib import suppress
from datetime import datetime, timezone
from enum import Enum
from os import getenv
from warnings import filterwarnings
Expand Down Expand Up @@ -56,12 +55,13 @@ def configure_runtime_type_checking_mode() -> None: # pragma: no cover
)


_PEP585_DATE = 2025
if datetime.now(tz=timezone.utc).year <= _PEP585_DATE: # pragma: no cover
with suppress(ImportError, ModuleNotFoundError):
from beartype.roar import BeartypeDecorHintPep585DeprecationWarning
# Suppress PEP 585 deprecation warnings from beartype for backwards compatibility
# PEP 585 (Python 3.9+) allows using list[], dict[] instead of typing.List[], typing.Dict[]
# This warning suppression can be removed once the codebase fully migrates to PEP 585 style
with suppress(ImportError, ModuleNotFoundError, AttributeError): # pragma: no cover
from beartype.roar import BeartypeDecorHintPep585DeprecationWarning

filterwarnings(
'ignore',
category=BeartypeDecorHintPep585DeprecationWarning,
)
filterwarnings(
'ignore',
category=BeartypeDecorHintPep585DeprecationWarning,
)