Esempio n. 1
0
def handle_sweep_config_violations(warnings: List[str]) -> None:
    """Render warnings from gorilla describing the ways in which a
    sweep config violates the allowed schema as terminal warnings.

    Parameters
    ----------
    warnings: list of str
        The warnings to render.
    """

    warning = sweep_config_err_text_from_jsonschema_violations(warnings)
    if len(warnings) > 0:
        term.termwarn(warning)
Esempio n. 2
0
 def store_path(self, artifact, path, name=None, checksum=False, max_objects=None):
     url = urlparse(path)
     if name is None:
         raise ValueError(
             'You must pass name="<entry_name>" when tracking references with unknown schemes. ref: %s'
             % path
         )
     termwarn(
         "Artifact references with unsupported schemes cannot be checksummed: %s"
         % path
     )
     name = name or url.path[1:]  # strip leading slash
     return [ArtifactManifestEntry(name, path, digest=path)]
Esempio n. 3
0
def handle_sweep_config_violations(warnings):
    """Render warnings from gorilla describing the ways in which a 
    sweep config violates the allowed schema as terminal warnings.

    Parameters
    ----------
    warnings: list of str
        The warnings to render.
    """

    warning_base = (
        "Malformed sweep config detected! This may cause your sweep to behave in unexpected ways.\n"
        "To avoid this, please fix the sweep config schema violations below:")

    for i, warning in enumerate(warnings):
        warnings[i] = "  Violation {}. {}".format(i + 1, warning)
    warning = "\n".join([warning_base] + warnings)

    if len(warnings) > 0:
        term.termwarn(warning)