From c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 1 Mar 2022 23:55:42 -0500 Subject: move a bunch of imports into TYPE_CHECKING blocks These are only used for type checking, so don't bother importing them at runtime. Generally add future annotations at the same time, to make sure that existing uses of these imports don't need to be quoted. --- mesonbuild/dependencies/pkgconfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mesonbuild/dependencies') diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py index 73f2e60..55a364c 100644 --- a/mesonbuild/dependencies/pkgconfig.py +++ b/mesonbuild/dependencies/pkgconfig.py @@ -11,9 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import annotations from .base import ExternalDependency, DependencyException, sort_libpaths, DependencyTypeName -from ..mesonlib import MachineChoice, OptionKey, OrderedSet, PerMachine, Popen_safe +from ..mesonlib import OptionKey, OrderedSet, PerMachine, Popen_safe from ..programs import find_external_program, ExternalProgram from .. import mlog from pathlib import PurePath @@ -24,6 +25,7 @@ import typing as T if T.TYPE_CHECKING: from ..environment import Environment + from ..mesonlib import MachineChoice from .._typing import ImmutableListProtocol class PkgConfigDependency(ExternalDependency): -- cgit v1.1