diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-08-27 18:43:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-27 18:43:07 +0200 |
commit | 1297673a7030aa3dd683c90774fd0f066f821ab1 (patch) | |
tree | 978874c57ab93980757708f1e5b1fed4f4a2582f /lib | |
parent | 0fee2c234ef1eda5483a2da5c6bd679c48d7ab26 (diff) | |
download | spack-1297673a7030aa3dd683c90774fd0f066f821ab1.tar.gz spack-1297673a7030aa3dd683c90774fd0f066f821ab1.tar.bz2 spack-1297673a7030aa3dd683c90774fd0f066f821ab1.tar.xz spack-1297673a7030aa3dd683c90774fd0f066f821ab1.zip |
Remove "prevent_cray_detection" context manager (#46060)
This context manager was used to prevent detecting a platform
as "cray". Since now Cray machines are detected as linux, we can
remove the context manager.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/bootstrap/config.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/platforms/__init__.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/platforms/_functions.py | 15 |
3 files changed, 2 insertions, 18 deletions
diff --git a/lib/spack/spack/bootstrap/config.py b/lib/spack/spack/bootstrap/config.py index 3feaef1d37..51edeccc25 100644 --- a/lib/spack/spack/bootstrap/config.py +++ b/lib/spack/spack/bootstrap/config.py @@ -152,7 +152,7 @@ def _ensure_bootstrap_configuration() -> Generator: bootstrap_store_path = store_path() user_configuration = _read_and_sanitize_configuration() with spack.environment.no_active_environment(): - with spack.platforms.prevent_cray_detection(), spack.platforms.use_platform( + with spack.platforms.use_platform( spack.platforms.real_host() ), spack.repo.use_repositories(spack.paths.packages_path): # Default configuration scopes excluding command line diff --git a/lib/spack/spack/platforms/__init__.py b/lib/spack/spack/platforms/__init__.py index 87566bf87f..e49f87b2a7 100644 --- a/lib/spack/spack/platforms/__init__.py +++ b/lib/spack/spack/platforms/__init__.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import contextlib -from ._functions import _host, by_name, platforms, prevent_cray_detection, reset +from ._functions import _host, by_name, platforms, reset from ._platform import Platform from .darwin import Darwin from .freebsd import FreeBSD @@ -23,7 +23,6 @@ __all__ = [ "host", "by_name", "reset", - "prevent_cray_detection", ] #: The "real" platform of the host running Spack. This should not be changed diff --git a/lib/spack/spack/platforms/_functions.py b/lib/spack/spack/platforms/_functions.py index 92c8ee800e..80ff277d21 100644 --- a/lib/spack/spack/platforms/_functions.py +++ b/lib/spack/spack/platforms/_functions.py @@ -2,12 +2,8 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import contextlib - import llnl.util.lang -import spack.util.environment - from .darwin import Darwin from .freebsd import FreeBSD from .linux import Linux @@ -57,14 +53,3 @@ def by_name(name): """ platform_cls = cls_by_name(name) return platform_cls() if platform_cls else None - - -@contextlib.contextmanager -def prevent_cray_detection(): - """Context manager that prevents the detection of the Cray platform""" - reset() - try: - with spack.util.environment.set_env(MODULEPATH=""): - yield - finally: - reset() |