diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-22 20:28:59 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-29 16:44:54 -0400 |
commit | c9938f8f60c0b7cca7a5668807b17badb7861c86 (patch) | |
tree | 6bbdb301a2c8ce4b92866a04703ada96241683b4 /mesonbuild/modules/java.py | |
parent | 05cfe756f1c2dbd212aa6d30a3879cfe47a7f2fd (diff) | |
download | meson-c9938f8f60c0b7cca7a5668807b17badb7861c86.zip meson-c9938f8f60c0b7cca7a5668807b17badb7861c86.tar.gz meson-c9938f8f60c0b7cca7a5668807b17badb7861c86.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/modules/java.py')
-rw-r--r-- | mesonbuild/modules/java.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mesonbuild/modules/java.py b/mesonbuild/modules/java.py index 22b8d2c..a8e5062 100644 --- a/mesonbuild/modules/java.py +++ b/mesonbuild/modules/java.py @@ -11,17 +11,23 @@ # 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 import os import pathlib import typing as T + from mesonbuild import mesonlib from mesonbuild.build import CustomTarget, CustomTargetIndex, GeneratedList, Target -from mesonbuild.compilers import detect_compiler_for, Compiler -from mesonbuild.interpreter import Interpreter +from mesonbuild.compilers import detect_compiler_for from mesonbuild.interpreterbase.decorators import ContainerTypeInfo, FeatureDeprecated, FeatureNew, KwargInfo, typed_pos_args, typed_kwargs from mesonbuild.mesonlib import version_compare, MachineChoice -from . import NewExtensionModule, ModuleReturnValue, ModuleState +from . import NewExtensionModule, ModuleReturnValue + +if T.TYPE_CHECKING: + from . import ModuleState + from ..compilers import Compiler + from ..interpreter import Interpreter class JavaModule(NewExtensionModule): @FeatureNew('Java Module', '0.60.0') |