summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2024-11-29 19:08:58 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2024-12-04 22:49:18 -0800
commitaa81d59958e42cfc34978d8d162818ee12f524a9 (patch)
tree5bf7387cd5e9e9acaa8b6343f0bb8310234092f8
parent6aafefd43dbda58f76c6dd37ddbccf65aedf31e4 (diff)
downloadspack-aa81d59958e42cfc34978d8d162818ee12f524a9.tar.gz
spack-aa81d59958e42cfc34978d8d162818ee12f524a9.tar.bz2
spack-aa81d59958e42cfc34978d8d162818ee12f524a9.tar.xz
spack-aa81d59958e42cfc34978d8d162818ee12f524a9.zip
directives: don't include `Optional` in `PatchesType`
`Optional` shouldn't be part of `PatchesType` -- it's clearer to specify `Optional` it in the methods that need their arguments to be optional. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
-rw-r--r--lib/spack/spack/directives.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py
index 44d95f3837..41fc314b03 100644
--- a/lib/spack/spack/directives.py
+++ b/lib/spack/spack/directives.py
@@ -82,7 +82,7 @@ SpecType = str
DepType = Union[Tuple[str, ...], str]
WhenType = Optional[Union[spack.spec.Spec, str, bool]]
Patcher = Callable[[Union[spack.package_base.PackageBase, Dependency]], None]
-PatchesType = Optional[Union[Patcher, str, List[Union[Patcher, str]]]]
+PatchesType = Union[Patcher, str, List[Union[Patcher, str]]]
SUPPORTED_LANGUAGES = ("fortran", "cxx", "c")
@@ -254,7 +254,7 @@ def _depends_on(
*,
when: WhenType = None,
type: DepType = dt.DEFAULT_TYPES,
- patches: PatchesType = None,
+ patches: Optional[PatchesType] = None,
):
when_spec = _make_when_spec(when)
if not when_spec:
@@ -348,7 +348,7 @@ def depends_on(
spec: SpecType,
when: WhenType = None,
type: DepType = dt.DEFAULT_TYPES,
- patches: PatchesType = None,
+ patches: Optional[PatchesType] = None,
):
"""Creates a dict of deps with specs defining when they apply.