diff options
| author | Eli Schwartz <eschwartz@archlinux.org> | 2023-01-17 18:19:59 -0500 |
|---|---|---|
| committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-06-26 13:10:33 -0400 |
| commit | b1ddfabf8fbb0561a584bd7cfe2bb712b4105da2 (patch) | |
| tree | 6cd7047a090608705215608940af3f7a03ee2442 /mesonbuild/mdevenv.py | |
| parent | c82305db0c5216f821e43bfc7ea3c8e314d0dccd (diff) | |
| download | meson-b1ddfabf8fbb0561a584bd7cfe2bb712b4105da2.tar.gz | |
dependencies: defer importing a custom dependency until it is used
This lessens the amount of code imported at Meson startup by mapping
each dependency to a dictionary entry and using a programmable import to
dynamically return it.
Minus 16 files and 6399 lines of code imported at startup.
Diffstat (limited to 'mesonbuild/mdevenv.py')
| -rw-r--r-- | mesonbuild/mdevenv.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/mdevenv.py b/mesonbuild/mdevenv.py index 624fec99e..9c298478d 100644 --- a/mesonbuild/mdevenv.py +++ b/mesonbuild/mdevenv.py @@ -7,7 +7,7 @@ import shutil import itertools from pathlib import Path -from . import build, minstall, dependencies +from . import build, minstall from .mesonlib import (MesonException, is_windows, setup_vsenv, OptionKey, get_wine_shortpath, MachineChoice) from . import mlog @@ -75,9 +75,10 @@ def get_env(b: build.Build, dump_fmt: T.Optional[str]) -> T.Tuple[T.Dict[str, st return env, varnames def bash_completion_files(b: build.Build, install_data: 'InstallData') -> T.List[str]: + from .dependencies.pkgconfig import PkgConfigDependency result = [] - dep = dependencies.PkgConfigDependency('bash-completion', b.environment, - {'required': False, 'silent': True, 'version': '>=2.10'}) + dep = PkgConfigDependency('bash-completion', b.environment, + {'required': False, 'silent': True, 'version': '>=2.10'}) if dep.found(): prefix = b.environment.coredata.get_option(OptionKey('prefix')) assert isinstance(prefix, str), 'for mypy' |
