Assign priorities to configuration scopes (take 2) (#49187)
Currently, the custom config scopes are pushed at the top when constructing configuration, and are demoted whenever a context manager activating an environment is used - see #48414 for details. Workflows that rely on the order in the [docs](https://spack.readthedocs.io/en/latest/configuration.html#custom-scopes) are thus fragile, and may break This PR allows to assign priorities to scopes, and ensures that scopes of lower priorities are always "below" scopes of higher priorities. When scopes have the same priority, what matters is the insertion order. Modifications: - [x] Add a mapping that iterates over keys according to priorities set when adding the key/value pair - [x] Use that mapping to allow assigning priorities to configuration scopes - [x] Assign different priorities for different kind of scopes, to fix a bug, and add a regression test - [x] Simplify `Configuration` constructor - [x] Remove `Configuration.pop_scope` --------- Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:

committed by
GitHub

parent
ae5e121502
commit
dbd531112c
@@ -223,6 +223,10 @@ def setup(sphinx):
|
||||
("py:class", "spack.compiler.CompilerCache"),
|
||||
# TypeVar that is not handled correctly
|
||||
("py:class", "llnl.util.lang.T"),
|
||||
("py:class", "llnl.util.lang.KT"),
|
||||
("py:class", "llnl.util.lang.VT"),
|
||||
("py:obj", "llnl.util.lang.KT"),
|
||||
("py:obj", "llnl.util.lang.VT"),
|
||||
]
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
|
Reference in New Issue
Block a user