diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-01 23:55:42 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-07 19:09:50 -0500 |
commit | c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e (patch) | |
tree | e2e782b9d7883b96a1bcecc13ddc51d6656bdf20 /mesonbuild/interpreterbase/interpreterbase.py | |
parent | a009eacc65ddb447edcfc9fd317ad828d9b3353a (diff) | |
download | meson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.zip meson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.tar.gz meson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild/interpreterbase/interpreterbase.py')
-rw-r--r-- | mesonbuild/interpreterbase/interpreterbase.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py index 28211b0..85aabd1 100644 --- a/mesonbuild/interpreterbase/interpreterbase.py +++ b/mesonbuild/interpreterbase/interpreterbase.py @@ -14,6 +14,7 @@ # This class contains the basic functionality needed to run any interpreter # or an interpreter-based tool. +from __future__ import annotations from .. import mparser, mesonlib from .. import environment @@ -26,10 +27,7 @@ from .baseobjects import ( ObjectHolder, IterableObject, - SubProject, - TYPE_var, - TYPE_kwargs, HoldableTypes, ) @@ -54,6 +52,7 @@ import typing as T import textwrap if T.TYPE_CHECKING: + from .baseobjects import SubProject, TYPE_kwargs from ..interpreter import Interpreter HolderMapType = T.Dict[ |