diff --git a/pyproject.toml b/pyproject.toml index 258e584..343cb24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,9 @@ exclude = [ [tool.ruff] line-length = 79 -select = ["ANN", "B", "D", "D204", "E", "F", "Q", "RUF", "SIM", "UP", "W"] +select = [ + "ANN", "B", "D", "D204", "E", "F", "Q", "RUF", "SIM", "TCH", "UP", "W", +] ignore = [ # Wat, type annotations for self and cls, why is this a thing? "ANN101", diff --git a/referencing/exceptions.py b/referencing/exceptions.py index fa6333f..d7ed823 100644 --- a/referencing/exceptions.py +++ b/referencing/exceptions.py @@ -8,10 +8,10 @@ import attrs from referencing._attrs import frozen -from referencing.typing import URI if TYPE_CHECKING: from referencing import Resource + from referencing.typing import URI @frozen diff --git a/referencing/retrieval.py b/referencing/retrieval.py index d8ab895..589f1f8 100644 --- a/referencing/retrieval.py +++ b/referencing/retrieval.py @@ -4,11 +4,13 @@ from __future__ import annotations from functools import lru_cache -from typing import Callable, TypeVar +from typing import TYPE_CHECKING, Callable, TypeVar import json from referencing import Resource -from referencing.typing import URI, D, Retrieve + +if TYPE_CHECKING: + from referencing.typing import URI, D, Retrieve #: A serialized document (e.g. a JSON string) _T = TypeVar("_T")