diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-05-26 09:33:52 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-06-01 22:49:10 -0400 |
commit | 3260c0ebdb47f2836b78204806114e7ddb84c51f (patch) | |
tree | 07a05093787346e4941033710176fd001e35682b | |
parent | 77e411088028180a82dedc4da709a3cd8be91b65 (diff) | |
download | meson-3260c0ebdb47f2836b78204806114e7ddb84c51f.zip meson-3260c0ebdb47f2836b78204806114e7ddb84c51f.tar.gz meson-3260c0ebdb47f2836b78204806114e7ddb84c51f.tar.bz2 |
ast/introspection: tidy up imports a bit more with __future__.annotations
This lets us not import quite as much at runtime
-rw-r--r-- | mesonbuild/ast/introspection.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 5400511..135ce05 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -15,6 +15,7 @@ # This class contains the basic functionality needed to run any interpreter # or an interpreter-based tool +from __future__ import annotations import argparse import copy import os @@ -22,13 +23,17 @@ import typing as T from .. import compilers, environment, mesonlib, optinterpreter from .. import coredata as cdata -from ..build import BuildTarget, Executable, Jar, SharedLibrary, SharedModule, StaticLibrary +from ..build import Executable, Jar, SharedLibrary, SharedModule, StaticLibrary from ..compilers import detect_compiler_for -from ..interpreterbase import InvalidArguments, TYPE_nvar +from ..interpreterbase import InvalidArguments from ..mesonlib import MachineChoice, OptionKey from ..mparser import BaseNode, ArithmeticNode, ArrayNode, ElementaryNode, IdNode, FunctionNode, StringNode from .interpreter import AstInterpreter -from .visitor import AstVisitor + +if T.TYPE_CHECKING: + from ..build import BuildTarget + from ..interpreterbase import TYPE_nvar + from .visitor import AstVisitor build_target_functions = ['executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library', 'both_libraries'] |