From 85c125a0f5f19738c63b6796762e7857bd85ae15 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 6 Jan 2025 20:06:02 +0100 Subject: [PATCH] Remove spack.config.add_default_platform_scope (#48425) This function is used only in tests, and pushes a scope to the current global CONFIG, when on Windows, regardless of what that CONFIG is. --- lib/spack/spack/config.py | 6 ------ lib/spack/spack/test/conftest.py | 5 ----- 2 files changed, 11 deletions(-) diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index b425c971033..ab18ed507e4 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -951,12 +951,6 @@ def set(path: str, value: Any, scope: Optional[str] = None) -> None: return CONFIG.set(path, value, scope) -def add_default_platform_scope(platform: str) -> None: - plat_name = os.path.join("defaults", platform) - plat_path = os.path.join(CONFIGURATION_DEFAULTS_PATH[1], platform) - CONFIG.push_scope(DirectoryConfigScope(plat_name, plat_path)) - - def scopes() -> Dict[str, ConfigScope]: """Convenience function to get list of configuration scopes.""" return CONFIG.scopes diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py index e1d445f5a1c..39c13b8e6a5 100644 --- a/lib/spack/spack/test/conftest.py +++ b/lib/spack/spack/test/conftest.py @@ -635,11 +635,6 @@ def ensure_debug(monkeypatch): tty.set_debug(current_debug_level) -@pytest.fixture(autouse=sys.platform == "win32", scope="session") -def platform_config(): - spack.config.add_default_platform_scope(spack.platforms.real_host().name) - - @pytest.fixture def default_config(): """Isolates the default configuration from the user configs.