INNER CODE UNIT · Python

validate_distribution_provenance

RockxyApp/Rockxy · releases/validate_metadata.py:160

def validate_distribution_provenance(
    path: Path,
    data: dict[str, Any],
    required: set[str],
    *,
    snake_case: bool,
    require_all: bool,
) -> None:
    if not any(key in data for key in required):
        if require_all:
            fail(f"{path} is missing required distribution provenance")
        return
    missing = sorted(key for key in required if data.get(key) in ("", None, False))
    if missing:
        fail(f"{path} has incomplete distribution provenance: {', '.join(missing)}")

    def field(snake: str, camel: str) -> str:
        return snake if snake_case else camel

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…