diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-12-11 11:48:21 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2024-02-23 08:47:01 -0800 |
commit | 95b3b9f710a19726f44eb76b15a6690e90c55b37 (patch) | |
tree | 16754648c5d5b3a15756b7498eff0229297c7576 /run_tests.py | |
parent | 39e1bf19fb653ac4f040e48b9a33aaa59dea1196 (diff) | |
download | meson-95b3b9f710a19726f44eb76b15a6690e90c55b37.zip meson-95b3b9f710a19726f44eb76b15a6690e90c55b37.tar.gz meson-95b3b9f710a19726f44eb76b15a6690e90c55b37.tar.bz2 |
coredata: use a Protocol for shared options between setup configure and dist
These are all passed around interchangably inside Meson, so use a shared
protocol for them.
Diffstat (limited to 'run_tests.py')
-rwxr-xr-x | run_tests.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/run_tests.py b/run_tests.py index 5347be8..2076532 100755 --- a/run_tests.py +++ b/run_tests.py @@ -1,6 +1,9 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 # Copyright 2012-2021 The Meson development team +# Copyright © 2023-2024 Intel Corporation + +from __future__ import annotations # Work around some pathlib bugs... from mesonbuild import _pathlib @@ -33,6 +36,9 @@ from mesonbuild.environment import Environment, detect_ninja, detect_machine_inf from mesonbuild.coredata import backendlist, version as meson_version from mesonbuild.mesonlib import OptionKey, setup_vsenv +if T.TYPE_CHECKING: + from mesonbuild.coredata import SharedCMDOptions + NINJA_1_9_OR_NEWER = False NINJA_CMD = None # If we're on CI, detecting ninja for every subprocess unit test that we run is slow @@ -133,9 +139,8 @@ class FakeCompilerOptions: def __init__(self): self.value = [] -# TODO: use a typing.Protocol here -def get_fake_options(prefix: str = '') -> argparse.Namespace: - opts = argparse.Namespace() +def get_fake_options(prefix: str = '') -> SharedCMDOptions: + opts = T.cast('SharedCMDOptions', argparse.Namespace()) opts.native_file = [] opts.cross_file = None opts.wrap_mode = None |