config.py: undo reintroduction of ConfigurationType
This commit is contained in:
parent
848816efa4
commit
2e2f76819c
@ -125,7 +125,7 @@ def all_compilers(scope: Optional[str] = None, init_config: bool = True) -> List
|
|||||||
|
|
||||||
|
|
||||||
def _init_packages_yaml(
|
def _init_packages_yaml(
|
||||||
configuration: spack.config.ConfigurationType, *, scope: Optional[str]
|
configuration: spack.config.Configuration, *, scope: Optional[str]
|
||||||
) -> None:
|
) -> None:
|
||||||
# Try importing from compilers.yaml
|
# Try importing from compilers.yaml
|
||||||
legacy_compilers = CompilerFactory.from_compilers_yaml(configuration, scope=scope)
|
legacy_compilers = CompilerFactory.from_compilers_yaml(configuration, scope=scope)
|
||||||
@ -151,7 +151,7 @@ def _init_packages_yaml(
|
|||||||
|
|
||||||
|
|
||||||
def all_compilers_from(
|
def all_compilers_from(
|
||||||
configuration: spack.config.ConfigurationType, scope: Optional[str] = None
|
configuration: spack.config.Configuration, scope: Optional[str] = None
|
||||||
) -> List[spack.spec.Spec]:
|
) -> List[spack.spec.Spec]:
|
||||||
"""Returns all the compilers from the current global configuration.
|
"""Returns all the compilers from the current global configuration.
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ def all_compilers_from(
|
|||||||
class CompilerRemover:
|
class CompilerRemover:
|
||||||
"""Removes compiler from configuration."""
|
"""Removes compiler from configuration."""
|
||||||
|
|
||||||
def __init__(self, configuration: spack.config.ConfigurationType) -> None:
|
def __init__(self, configuration: spack.config.Configuration) -> None:
|
||||||
self.configuration = configuration
|
self.configuration = configuration
|
||||||
self.marked_packages_yaml: List[Tuple[str, Any]] = []
|
self.marked_packages_yaml: List[Tuple[str, Any]] = []
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ class CompilerFactory:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_packages_yaml(
|
def from_packages_yaml(
|
||||||
configuration: spack.config.ConfigurationType, *, scope: Optional[str] = None
|
configuration: spack.config.Configuration, *, scope: Optional[str] = None
|
||||||
) -> List[spack.spec.Spec]:
|
) -> List[spack.spec.Spec]:
|
||||||
"""Returns the compiler specs defined in the "packages" section of the configuration"""
|
"""Returns the compiler specs defined in the "packages" section of the configuration"""
|
||||||
compilers = []
|
compilers = []
|
||||||
@ -361,7 +361,7 @@ def from_legacy_yaml(compiler_dict: Dict[str, Any]) -> List[spack.spec.Spec]:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_compilers_yaml(
|
def from_compilers_yaml(
|
||||||
configuration: spack.config.ConfigurationType, *, scope: Optional[str] = None
|
configuration: spack.config.Configuration, *, scope: Optional[str] = None
|
||||||
) -> List[spack.spec.Spec]:
|
) -> List[spack.spec.Spec]:
|
||||||
"""Returns the compiler specs defined in the "compilers" section of the configuration"""
|
"""Returns the compiler specs defined in the "compilers" section of the configuration"""
|
||||||
result: List[spack.spec.Spec] = []
|
result: List[spack.spec.Spec] = []
|
||||||
|
@ -718,9 +718,6 @@ def print_section(self, section: str, blame: bool = False, *, scope=None) -> Non
|
|||||||
raise spack.error.ConfigError(f"cannot read '{section}' configuration") from e
|
raise spack.error.ConfigError(f"cannot read '{section}' configuration") from e
|
||||||
|
|
||||||
|
|
||||||
ConfigurationType = Union[Configuration, lang.Singleton]
|
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def override(
|
def override(
|
||||||
path_or_scope: Union[ConfigScope, str], value: Optional[Any] = None
|
path_or_scope: Union[ConfigScope, str], value: Optional[Any] = None
|
||||||
|
Loading…
Reference in New Issue
Block a user