move base class for system dependencies into base.py

In accordance with review comments; it's small enough this seems fitting.
pull/8888/head
Eli Schwartz 3 years ago
parent fbeb62101c
commit 493dc6ed10
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 17
      mesonbuild/dependencies/base.py
  2. 3
      mesonbuild/dependencies/boost.py
  3. 3
      mesonbuild/dependencies/coarrays.py
  4. 3
      mesonbuild/dependencies/cuda.py
  5. 3
      mesonbuild/dependencies/dev.py
  6. 2
      mesonbuild/dependencies/factory.py
  7. 2
      mesonbuild/dependencies/misc.py
  8. 3
      mesonbuild/dependencies/mpi.py
  9. 29
      mesonbuild/dependencies/system.py
  10. 3
      mesonbuild/dependencies/ui.py
  11. 2
      mesonbuild/modules/python.py

@ -534,3 +534,20 @@ def detect_compiler(name: str, env: 'Environment', for_machine: MachineChoice,
except KeyError:
continue
return None
class SystemDependency(ExternalDependency):
"""Dependency base for System type dependencies."""
def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any],
language: T.Optional[str] = None) -> None:
super().__init__(DependencyTypeName('system'), env, kwargs, language=language)
self.name = name
@staticmethod
def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.SYSTEM]
def log_tried(self) -> str:
return 'system'

@ -21,10 +21,9 @@ from .. import mlog
from .. import mesonlib
from ..environment import Environment
from .base import DependencyException
from .base import DependencyException, SystemDependency
from .pkgconfig import PkgConfigDependency
from .misc import threads_factory
from .system import SystemDependency
if T.TYPE_CHECKING:
from ..environment import Properties

@ -15,11 +15,10 @@
import functools
import typing as T
from .base import DependencyMethods, detect_compiler
from .base import DependencyMethods, detect_compiler, SystemDependency
from .cmake import CMakeDependency
from .pkgconfig import PkgConfigDependency
from .factory import factory_methods
from .system import SystemDependency
if T.TYPE_CHECKING:
from . factory import DependencyGenerator

@ -21,8 +21,7 @@ from pathlib import Path
from .. import mesonlib
from .. import mlog
from ..environment import detect_cpu_family
from .base import DependencyException
from .system import SystemDependency
from .base import DependencyException, SystemDependency
if T.TYPE_CHECKING:

@ -26,13 +26,12 @@ from .. import mesonlib, mlog
from ..compilers import AppleClangCCompiler, AppleClangCPPCompiler
from ..environment import get_llvm_tool_names
from ..mesonlib import version_compare, stringlistify, extract_as_list, MachineChoice
from .base import DependencyException, DependencyMethods, strip_system_libdirs
from .base import DependencyException, DependencyMethods, strip_system_libdirs, SystemDependency
from .cmake import CMakeDependency
from .configtool import ConfigToolDependency
from .factory import DependencyFactory
from .misc import threads_factory
from .pkgconfig import PkgConfigDependency
from .system import SystemDependency
if T.TYPE_CHECKING:
from ..envconfig import MachineInfo

@ -20,10 +20,10 @@ from ..mesonlib import MachineChoice
from .base import DependencyException, DependencyMethods
from .base import ExternalDependency
from .base import process_method_kw
from .base import SystemDependency
from .cmake import CMakeDependency
from .framework import ExtraFrameworkDependency
from .pkgconfig import PkgConfigDependency
from .system import SystemDependency
if T.TYPE_CHECKING:
from ..environment import Environment

@ -24,11 +24,11 @@ from .. import mesonlib
from .. import mlog
from ..environment import detect_cpu_family
from .base import DependencyException, DependencyMethods
from .base import SystemDependency
from .cmake import CMakeDependency
from .configtool import ConfigToolDependency
from .factory import DependencyFactory, factory_methods
from .pkgconfig import PkgConfigDependency
from .system import SystemDependency
if T.TYPE_CHECKING:
from ..environment import Environment, MachineChoice

@ -18,11 +18,10 @@ import os
import re
from ..environment import detect_cpu_family
from .base import DependencyMethods, detect_compiler
from .base import DependencyMethods, detect_compiler, SystemDependency
from .configtool import ConfigToolDependency
from .factory import factory_methods
from .pkgconfig import PkgConfigDependency
from .system import SystemDependency
if T.TYPE_CHECKING:
from .factory import DependencyGenerator

@ -1,29 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright © 2021 Intel Corporation
from .base import DependencyTypeName, ExternalDependency, DependencyMethods
import typing as T
if T.TYPE_CHECKING:
from ..environment import Environment
__all__ = [
'SystemDependency',
]
class SystemDependency(ExternalDependency):
"""Dependency base for System type dependencies."""
def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any],
language: T.Optional[str] = None) -> None:
super().__init__(DependencyTypeName('system'), env, kwargs, language=language)
self.name = name
@staticmethod
def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.SYSTEM]
def log_tried(self) -> str:
return 'system'

@ -25,10 +25,9 @@ from ..mesonlib import (
)
from ..environment import detect_cpu_family
from .base import DependencyException, DependencyMethods, DependencyTypeName
from .base import DependencyException, DependencyMethods, DependencyTypeName, SystemDependency
from .configtool import ConfigToolDependency
from .factory import DependencyFactory
from .system import SystemDependency
if T.TYPE_CHECKING:
from ..environment import Environment

@ -31,7 +31,7 @@ from ..build import known_shmod_kwargs
from .. import mlog
from ..environment import detect_cpu_family
from ..dependencies import DependencyMethods, PkgConfigDependency, NotFoundDependency
from ..dependencies.system import SystemDependency
from ..dependencies.base import SystemDependency
from ..programs import ExternalProgram, NonExistingExternalProgram
mod_kwargs = {'subdir'}

Loading…
Cancel
Save