spack/var/spack/repos
Harmen Stoppels 1235084c20
Introduce default_args context manager (#39964)
This adds a rather trivial context manager that lets you deduplicate repeated
arguments in directives, e.g.

```python
depends_on("py-x@1", when="@1", type=("build", "run"))
depends_on("py-x@2", when="@2", type=("build", "run"))
depends_on("py-x@3", when="@3", type=("build", "run"))
depends_on("py-x@4", when="@4", type=("build", "run"))
```

can be condensed to

```python
with default_args(type=("build", "run")):
    depends_on("py-x@1", when="@1")
    depends_on("py-x@2", when="@2")
    depends_on("py-x@3", when="@3")
    depends_on("py-x@4", when="@4")
```

The advantage is it's clear for humans, the downside it's less clear for type checkers due to type erasure.
2023-11-06 10:22:29 -08:00
..
builder.test
builtin Introduce default_args context manager (#39964) 2023-11-06 10:22:29 -08:00
builtin.mock Bugfix: propagation of multivalued variants (#39833) 2023-11-03 12:09:39 -07:00
duplicates.test
edges.test ASP-based solver: fix for unsplittable providers (#40859) 2023-11-03 12:56:37 +01:00
tutorial