spack.package / builtin repo: fix exports/imports (#47617)
Add various missing imports in packages. Remove redundant imports Export NoLibrariesError, NoHeadersError, which_string in spack.package
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
from os import chdir, environ, getcwd, makedirs, mkdir, remove, removedirs
|
||||
from shutil import move, rmtree
|
||||
|
||||
from spack.error import InstallError
|
||||
from spack.error import InstallError, NoHeadersError, NoLibrariesError
|
||||
|
||||
# Emulate some shell commands for convenience
|
||||
env = environ
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.error
|
||||
from spack.util.environment import EnvironmentModifications
|
||||
import spack.util.environment
|
||||
|
||||
__all__ = ["Executable", "which", "ProcessError"]
|
||||
__all__ = ["Executable", "which", "which_string", "ProcessError"]
|
||||
|
||||
|
||||
class Executable:
|
||||
@@ -29,7 +29,7 @@ def __init__(self, name):
|
||||
|
||||
self.default_env = {}
|
||||
|
||||
self.default_envmod = EnvironmentModifications()
|
||||
self.default_envmod = spack.util.environment.EnvironmentModifications()
|
||||
self.returncode = None
|
||||
self.ignore_quotes = False
|
||||
|
||||
@@ -168,17 +168,15 @@ def process_cmd_output(out, err):
|
||||
self.default_envmod.apply_modifications(env)
|
||||
env.update(self.default_env)
|
||||
|
||||
from spack.util.environment import EnvironmentModifications # no cycle
|
||||
|
||||
# Apply env argument
|
||||
if isinstance(env_arg, EnvironmentModifications):
|
||||
if isinstance(env_arg, spack.util.environment.EnvironmentModifications):
|
||||
env_arg.apply_modifications(env)
|
||||
elif env_arg:
|
||||
env.update(env_arg)
|
||||
|
||||
# Apply extra env
|
||||
extra_env = kwargs.get("extra_env", {})
|
||||
if isinstance(extra_env, EnvironmentModifications):
|
||||
if isinstance(extra_env, spack.util.environment.EnvironmentModifications):
|
||||
extra_env.apply_modifications(env)
|
||||
else:
|
||||
env.update(extra_env)
|
||||
|
||||
Reference in New Issue
Block a user