ast/introspection: tidy up imports a bit more with __future__.annotations

This lets us not import quite as much at runtime
pull/10453/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent 77e4110880
commit 3260c0ebdb
  1. 11
      mesonbuild/ast/introspection.py

@ -15,6 +15,7 @@
# This class contains the basic functionality needed to run any interpreter # This class contains the basic functionality needed to run any interpreter
# or an interpreter-based tool # or an interpreter-based tool
from __future__ import annotations
import argparse import argparse
import copy import copy
import os import os
@ -22,13 +23,17 @@ import typing as T
from .. import compilers, environment, mesonlib, optinterpreter from .. import compilers, environment, mesonlib, optinterpreter
from .. import coredata as cdata 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 ..compilers import detect_compiler_for
from ..interpreterbase import InvalidArguments, TYPE_nvar from ..interpreterbase import InvalidArguments
from ..mesonlib import MachineChoice, OptionKey from ..mesonlib import MachineChoice, OptionKey
from ..mparser import BaseNode, ArithmeticNode, ArrayNode, ElementaryNode, IdNode, FunctionNode, StringNode from ..mparser import BaseNode, ArithmeticNode, ArrayNode, ElementaryNode, IdNode, FunctionNode, StringNode
from .interpreter import AstInterpreter 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'] build_target_functions = ['executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library', 'both_libraries']

Loading…
Cancel
Save