diff --git a/pydantic_extra_types/dsn.py b/pydantic_extra_types/dsn.py index 0ddf99c9..1ae06f6c 100644 --- a/pydantic_extra_types/dsn.py +++ b/pydantic_extra_types/dsn.py @@ -1,4 +1,9 @@ -from typing import Annotated +import sys + +if sys.version_info >= (3, 8): + from typing import Annotated +else: + from typing_extensions import Annotated from pydantic import UrlConstraints from pydantic_core import MultiHostUrl, Url diff --git a/pyproject.toml b/pyproject.toml index d713e4d1..1553a2af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,6 +77,7 @@ quote-style = 'single' [tool.ruff.lint.per-file-ignores] 'pydantic_extra_types/color.py' = ['E741'] +'pydantic_extra_types/dsn.py' = ['UP036'] [tool.coverage.run] source = ['pydantic_extra_types']