diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 61a494e974c..8275ca625a0 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -70,7 +70,7 @@ GitOrStandardVersion = Union[spack.version.GitVersion, spack.version.StandardVersion] -TransformFunction = Callable[["spack.spec.Spec", List[AspFunction]], List[AspFunction]] +TransformFunction = Callable[[spack.spec.Spec, List[AspFunction]], List[AspFunction]] #: Enable the addition of a runtime node WITH_RUNTIME = sys.platform != "win32" @@ -130,8 +130,8 @@ def __str__(self): @contextmanager def named_spec( - spec: Optional["spack.spec.Spec"], name: Optional[str] -) -> Iterator[Optional["spack.spec.Spec"]]: + spec: Optional[spack.spec.Spec], name: Optional[str] +) -> Iterator[Optional[spack.spec.Spec]]: """Context manager to temporarily set the name of a spec""" if spec is None or name is None: yield spec @@ -750,11 +750,11 @@ def on_model(model): class KnownCompiler(NamedTuple): """Data class to collect information on compilers""" - spec: "spack.spec.Spec" + spec: spack.spec.Spec os: str target: str available: bool - compiler_obj: Optional["spack.compiler.Compiler"] + compiler_obj: Optional[spack.compiler.Compiler] def _key(self): return self.spec, self.os, self.target @@ -1389,7 +1389,7 @@ def effect_rules(self): def define_variant( self, - pkg: "Type[spack.package_base.PackageBase]", + pkg: Type[spack.package_base.PackageBase], name: str, when: spack.spec.Spec, variant_def: vt.Variant, @@ -1493,7 +1493,7 @@ def define_auto_variant(self, name: str, multi: bool): ) ) - def variant_rules(self, pkg: "Type[spack.package_base.PackageBase]"): + def variant_rules(self, pkg: Type[spack.package_base.PackageBase]): for name in pkg.variant_names(): self.gen.h3(f"Variant {name} in package {pkg.name}") for when, variant_def in pkg.variant_definitions(name): @@ -1684,8 +1684,8 @@ def dependency_holds(input_spec, requirements): def _gen_match_variant_splice_constraints( self, pkg, - cond_spec: "spack.spec.Spec", - splice_spec: "spack.spec.Spec", + cond_spec: spack.spec.Spec, + splice_spec: spack.spec.Spec, hash_asp_var: "AspVar", splice_node, match_variants: List[str], @@ -2980,7 +2980,7 @@ def _specs_from_requires(self, pkg_name, section): for s in spec_group[key]: yield _spec_with_default_name(s, pkg_name) - def pkg_class(self, pkg_name: str) -> typing.Type["spack.package_base.PackageBase"]: + def pkg_class(self, pkg_name: str) -> typing.Type[spack.package_base.PackageBase]: request = pkg_name if pkg_name in self.explicitly_required_namespaces: namespace = self.explicitly_required_namespaces[pkg_name] @@ -3099,7 +3099,7 @@ def __init__(self, configuration) -> None: self.compilers.add(candidate) - def with_input_specs(self, input_specs: List["spack.spec.Spec"]) -> "CompilerParser": + def with_input_specs(self, input_specs: List[spack.spec.Spec]) -> "CompilerParser": """Accounts for input specs when building the list of possible compilers. Args: @@ -3138,7 +3138,7 @@ def with_input_specs(self, input_specs: List["spack.spec.Spec"]) -> "CompilerPar return self - def add_compiler_from_concrete_spec(self, spec: "spack.spec.Spec") -> None: + def add_compiler_from_concrete_spec(self, spec: spack.spec.Spec) -> None: """Account for compilers that are coming from concrete specs, through reuse. Args: