Example #1
0
 def from_dict(cls, alias: str, d: dict[str, Any]) -> DockerRegistryOptions:
     return cls(
         alias=alias,
         address=d["address"],
         default=Parser.ensure_bool(d.get("default", alias == "default")),
         skip_push=Parser.ensure_bool(
             d.get("skip_push", DockerRegistryOptions.skip_push)),
         extra_image_tags=tuple(
             d.get("extra_image_tags",
                   DockerRegistryOptions.extra_image_tags)),
     )
Example #2
0
 def parse(cls, value: bool | str) -> bool:
     try:
         return Parser.ensure_bool(value)
     except BooleanConversionError:
         enum_value = cls(value)
         bool_value = enum_value is not cls.NEVER
         deprecated_conditional(
             lambda: True,
             removal_version="2.6.0.dev0",
             entity_description=
             "python-setup resolve_all_constraints non boolean values",
             hint_message=
             f"Instead of {enum_value.value!r} use {bool_value!r}.",
         )
         return bool_value
Example #3
0
 def from_dict(cls, alias: str, d: dict[str, Any]) -> DockerRegistryOptions:
     return cls(
         alias=alias,
         address=d["address"],
         default=Parser.ensure_bool(d.get("default", alias == "default")),
     )
Example #4
0
 def from_dict(cls, alias: str, d: dict[str, Any]) -> HelmRegistry:
     return cls(
         alias=alias,
         address=cast(str, d["address"]).rstrip("/"),
         default=Parser.ensure_bool(d.get("default", alias == "default")),
     )