From c5c84252ebfa522317d0ae065f9722af4a80280a Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Mon, 18 Nov 2024 12:49:56 +0100 Subject: [PATCH] fix: make type_extensions import only for type checking --- raillabel/filter/filter.py | 3 ++- raillabel/stats/generate_timespan.py | 3 ++- raillabel/validate/validate.py | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/raillabel/filter/filter.py b/raillabel/filter/filter.py index e3ee76e..283dffa 100644 --- a/raillabel/filter/filter.py +++ b/raillabel/filter/filter.py @@ -5,7 +5,8 @@ import typing as t from warnings import warn -from typing_extensions import deprecated +if t.TYPE_CHECKING: + from typing_extensions import deprecated from .. import format from . import _filter_classes diff --git a/raillabel/stats/generate_timespan.py b/raillabel/stats/generate_timespan.py index 5847c31..af85c3e 100644 --- a/raillabel/stats/generate_timespan.py +++ b/raillabel/stats/generate_timespan.py @@ -5,7 +5,8 @@ from decimal import Decimal from warnings import warn -from typing_extensions import deprecated +if t.TYPE_CHECKING: + from typing_extensions import deprecated from ..format import Scene diff --git a/raillabel/validate/validate.py b/raillabel/validate/validate.py index 55c01cf..97057df 100644 --- a/raillabel/validate/validate.py +++ b/raillabel/validate/validate.py @@ -9,7 +9,9 @@ import fastjsonschema import jsonschema -from typing_extensions import deprecated + +if t.TYPE_CHECKING: + from typing_extensions import deprecated from .. import exceptions