From aa81d59958e42cfc34978d8d162818ee12f524a9 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 29 Nov 2024 19:08:58 -0800 Subject: 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 --- lib/spack/spack/directives.py | 6 +++--- 1 file 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. -- cgit v1.2.3-70-g09d2