From 967286b1adf899203104e3e10de3ec09a4cd690d Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Sat, 28 Sep 2024 19:52:03 +0200 Subject: [PATCH] chore: handle `TCH` violations --- python/deptry/dependency_getter/builder.py | 2 +- tests/utils.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/deptry/dependency_getter/builder.py b/python/deptry/dependency_getter/builder.py index 2cdfbfd8..38a7d2c4 100644 --- a/python/deptry/dependency_getter/builder.py +++ b/python/deptry/dependency_getter/builder.py @@ -1,7 +1,6 @@ from __future__ import annotations import logging -from collections.abc import Mapping from dataclasses import dataclass, field from pathlib import Path from typing import TYPE_CHECKING @@ -15,6 +14,7 @@ from deptry.utils import load_pyproject_toml if TYPE_CHECKING: + from collections.abc import Mapping from typing import Any from deptry.dependency_getter.base import DependencyGetter diff --git a/tests/utils.py b/tests/utils.py index 52860c1b..05e188d8 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -7,15 +7,17 @@ import subprocess import sys import venv -from collections.abc import Generator from contextlib import contextmanager from dataclasses import dataclass from pathlib import Path -from typing import Any +from typing import TYPE_CHECKING, Any from deptry.reporters.text import COLORS from tests.functional.utils import DEPTRY_WHEEL_DIRECTORY +if TYPE_CHECKING: + from collections.abc import Generator + @dataclass class _BaseVenvFactory: