summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-11-17 09:02:04 +0100
committerGitHub <noreply@github.com>2024-11-17 09:02:04 +0100
commit4d3b85c4d4769c36984f7fe556ec23405efedad4 (patch)
tree321a40894937fe7ada3b6279baed2885c1ae78b0 /lib
parentf05cbfbf44f326d00ae89993daca94a75d911d50 (diff)
downloadspack-4d3b85c4d4769c36984f7fe556ec23405efedad4.tar.gz
spack-4d3b85c4d4769c36984f7fe556ec23405efedad4.tar.bz2
spack-4d3b85c4d4769c36984f7fe556ec23405efedad4.tar.xz
spack-4d3b85c4d4769c36984f7fe556ec23405efedad4.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py2
-rw-r--r--lib/spack/spack/util/executable.py12
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 8a7795b2ce..525721ebb3 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -11,7 +11,7 @@ Everything in this module is automatically imported into Spack package files.
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
diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py
index 0c1901cb1a..83534f8000 100644
--- a/lib/spack/spack/util/executable.py
+++ b/lib/spack/spack/util/executable.py
@@ -12,9 +12,9 @@ from pathlib import Path, PurePath
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 @@ class Executable:
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 @@ class Executable:
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)