dannycjones commented on code in PR #3414:
URL: https://github.com/apache/iceberg-rust/pull/3414#discussion_r4260745125


##########
dev/release/licenses.py:
##########
@@ -56,6 +75,270 @@ def require_cargo_deny() -> None:
         )
 
 
+def declared_clarifications() -> set[CrateName]:
+    """Crate names that deny.toml carries a [[licenses.clarify]] block for."""
+    with DENY_TOML.open("rb") as handle:
+        config = tomllib.load(handle)
+
+    blocks = config.get("licenses", {}).get("clarify", [])
+    if not blocks:
+        raise Failure(
+            f"Expected at least one [[licenses.clarify]] block in {DENY_TOML}, 
found none.\n"
+            "If the last one was deliberately removed, remove this check with 
it."
+        )
+
+    pinned = sorted(block["crate"] for block in blocks if "@" in 
block["crate"])
+    if pinned:
+        raise Failure(
+            textwrap.dedent("""
+                {deny_toml} pins a [[licenses.clarify]] block to a crate 
version:
+                {specs}
+
+                Version pins are rejected by this script.
+                cargo-deny supports them, but will not report when they become 
stale.
+                To keep things simple, this script requires that no pinning is 
used.
+                Where newer versions change licensing, the script will reject 
the clarification
+                and the deny.toml file should be updated.
+                """).format(
+                deny_toml=DENY_TOML,
+                specs="\n".join(f"  {spec}" for spec in pinned),
+            )
+        )
+
+    return {block["crate"] for block in blocks}

Review Comment:
   Omitted intentionally: 
https://github.com/apache/iceberg-rust/pull/3414#discussion_r4260733893



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to