dependencies: move dub to a hidden package internal detail

Do not import it and expose it at the package scope, it's never used
elsewhere except inside the dub module.
pull/11907/head
Eli Schwartz 2 years ago
parent e715400d1b
commit 216f7476de
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/dependencies/__init__.py
  2. 9
      mesonbuild/modules/dlang.py

@ -21,7 +21,6 @@ from .base import (
BuiltinDependency, SystemDependency, get_leaf_external_dependencies)
from .cmake import CMakeDependency
from .configtool import ConfigToolDependency
from .dub import DubDependency
from .framework import ExtraFrameworkDependency
from .pkgconfig import PkgConfigDependency
from .factory import DependencyFactory
@ -57,7 +56,6 @@ __all__ = [
'CMakeDependency',
'ConfigToolDependency',
'DubDependency',
'ExtraFrameworkDependency',
'PkgConfigDependency',

@ -20,8 +20,9 @@ import json
import os
from . import ExtensionModule, ModuleInfo
from .. import dependencies
from .. import mlog
from ..dependencies import Dependency
from ..dependencies.dub import DubDependency
from ..interpreterbase import typed_pos_args
from ..mesonlib import Popen_safe, MesonException
@ -39,7 +40,7 @@ class DlangModule(ExtensionModule):
def _init_dub(self, state):
if DlangModule.class_dubbin is None:
self.dubbin = dependencies.DubDependency.class_dubbin
self.dubbin = DubDependency.class_dubbin
DlangModule.class_dubbin = self.dubbin
else:
self.dubbin = DlangModule.class_dubbin
@ -82,7 +83,7 @@ class DlangModule(ExtensionModule):
config[key] = {}
if isinstance(value, list):
for dep in value:
if isinstance(dep, dependencies.Dependency):
if isinstance(dep, Dependency):
name = dep.get_name()
ret, res = self._call_dubbin(['describe', name])
if ret == 0:
@ -91,7 +92,7 @@ class DlangModule(ExtensionModule):
config[key][name] = ''
else:
config[key][name] = version
elif isinstance(value, dependencies.Dependency):
elif isinstance(value, Dependency):
name = value.get_name()
ret, res = self._call_dubbin(['describe', name])
if ret == 0:

Loading…
Cancel
Save