From 642a28ecb8c823eb4ea6cc2ab6d3e7e16f1a5bd4 Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Mon, 3 Nov 2025 13:34:43 +0000 Subject: [PATCH] Use distinct type for dependencies' aliases & names --- pyhelm3/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyhelm3/models.py b/pyhelm3/models.py index d03fdc6..67b1a5b 100644 --- a/pyhelm3/models.py +++ b/pyhelm3/models.py @@ -46,6 +46,10 @@ def __init__(self, _command: Command, **kwargs): Name = constr(pattern = r"^[a-z0-9-]+$") +#: Type for a dependency alias or name (which gets populated from alias after installation) +DependencyAliasOrName = NonEmptyString + + #: Type for a SemVer version SemVerVersion = constr(pattern = r"^v?\d+\.\d+\.\d+(-[a-zA-Z0-9\.\-]+)?(\+[a-zA-Z0-9\.\-]+)?$") @@ -71,7 +75,7 @@ class ChartDependency(BaseModel): """ Model for a chart dependency. """ - name: Name = Field( + name: DependencyAliasOrName = Field( ..., description = "The name of the chart." ) @@ -99,7 +103,7 @@ class ChartDependency(BaseModel): "Each item can be a string or pair of child/parent sublist items." ) ) - alias: t.Optional[NonEmptyString] = Field( + alias: t.Optional[DependencyAliasOrName] = Field( None, description = "Alias to be used for the chart." )