summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/decorators.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-01 23:55:42 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-03-07 19:09:50 -0500
commitc231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e (patch)
treee2e782b9d7883b96a1bcecc13ddc51d6656bdf20 /mesonbuild/interpreterbase/decorators.py
parenta009eacc65ddb447edcfc9fd317ad828d9b3353a (diff)
downloadmeson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.tar.gz
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/decorators.py')
-rw-r--r--mesonbuild/interpreterbase/decorators.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/interpreterbase/decorators.py b/mesonbuild/interpreterbase/decorators.py
index 672ef5b9f..e678fd97f 100644
--- a/mesonbuild/interpreterbase/decorators.py
+++ b/mesonbuild/interpreterbase/decorators.py
@@ -11,12 +11,11 @@
# 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 .. import mesonlib, mlog
-from .baseobjects import TV_func, TYPE_var, TYPE_kwargs
from .disabler import Disabler
from .exceptions import InterpreterException, InvalidArguments
-from .operator import MesonOperator
from ._unholder import _unholder
from dataclasses import dataclass
@@ -30,8 +29,9 @@ if T.TYPE_CHECKING:
from typing_extensions import Protocol
from .. import mparser
- from .baseobjects import InterpreterObject
+ from .baseobjects import InterpreterObject, TV_func, TYPE_var, TYPE_kwargs
from .interpreterbase import SubProject
+ from .operator import MesonOperator
_TV_IntegerObject = T.TypeVar('_TV_IntegerObject', bound=InterpreterObject, contravariant=True)
_TV_ARG1 = T.TypeVar('_TV_ARG1', bound=TYPE_var, contravariant=True)