From c505f4f70ac353d8a3f7291ea1fb6ccc5ead27f1 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 19 Aug 2024 15:33:44 +0200 Subject: [PATCH] use packagebase --- lib/spack/spack/detection/path.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/spack/spack/detection/path.py b/lib/spack/spack/detection/path.py index ec94b71f141..9cdf536e0bd 100644 --- a/lib/spack/spack/detection/path.py +++ b/lib/spack/spack/detection/path.py @@ -18,10 +18,12 @@ import llnl.util.lang import llnl.util.tty +import spack.package_base import spack.util.elf as elf_utils import spack.util.environment import spack.util.environment as environment import spack.util.ld_so_conf +import spack.spec from .common import ( WindowsCompilerExternalPaths, @@ -201,7 +203,7 @@ class Finder: def default_path_hints(self) -> List[str]: return [] - def search_patterns(self, *, pkg: Type["spack.package_base.PackageBase"]) -> List[str]: + def search_patterns(self, *, pkg: Type[spack.package_base.PackageBase]) -> List[str]: """Returns the list of patterns used to match candidate files. Args: @@ -227,7 +229,7 @@ def prefix_from_path(self, *, path: str) -> str: raise NotImplementedError("must be implemented by derived classes") def detect_specs( - self, *, pkg: Type["spack.package_base.PackageBase"], paths: List[str] + self, *, pkg: Type[spack.package_base.PackageBase], paths: List[str] ) -> List["spack.spec.Spec"]: """Given a list of files matching the search patterns, returns a list of detected specs. @@ -303,7 +305,7 @@ def detect_specs( def find( self, *, pkg_name: str, repository, initial_guess: Optional[List[str]] = None - ) -> List["spack.spec.Spec"]: + ) -> List[spack.spec.Spec]: """For a given package, returns a list of detected specs. Args: @@ -328,7 +330,7 @@ class ExecutablesFinder(Finder): def default_path_hints(self) -> List[str]: return spack.util.environment.get_path("PATH") - def search_patterns(self, *, pkg: Type["spack.package_base.PackageBase"]) -> List[str]: + def search_patterns(self, *, pkg: Type[spack.package_base.PackageBase]) -> List[str]: result = [] if hasattr(pkg, "executables") and hasattr(pkg, "platform_executables"): result = pkg.platform_executables() @@ -354,7 +356,7 @@ class LibrariesFinder(Finder): DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH, and standard system library paths """ - def search_patterns(self, *, pkg: Type["spack.package_base.PackageBase"]) -> List[str]: + def search_patterns(self, *, pkg: Type[spack.package_base.PackageBase]) -> List[str]: result = [] if hasattr(pkg, "libraries"): result = pkg.libraries