Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packaging/distribution/autosentry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class Autosentry < Formula
license "Apache-2.0"
head "https://github.com/ulmentflam/autosentry.git", branch: "main"

depends_on "python@3.13"
# Ordered build > normal to satisfy FormulaAudit/DependencyOrder.
depends_on "rust" => :build # pydantic-core compiles from sdist via maturin/cargo
depends_on "python@3.13"

resource "annotated-doc" do
url "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz"
Expand Down Expand Up @@ -66,7 +67,7 @@ class Autosentry < Formula
sha256 "edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36"
end

resource "ruamel.yaml" do
resource "ruamel-yaml" do
url "https://files.pythonhosted.org/packages/c7/3b/ebda527b56beb90cb7652cb1c7e4f91f48649fbcd8d2eb2fb6e77cd3329b/ruamel_yaml-0.19.1.tar.gz"
sha256 "53eb66cd27849eff968ebf8f0bf61f46cdac2da1d1f3576dd4ccee9b25c31993"
end
Expand Down
10 changes: 8 additions & 2 deletions packaging/distribution/gen_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from __future__ import annotations

import json
import re
import subprocess
import sys
import urllib.request
Expand Down Expand Up @@ -86,8 +87,13 @@ def main() -> None:
blocks: list[tuple[str, str]] = []
for name, version in resolved:
canonical, url, sha = sdist(name, version)
block = f' resource "{canonical}" do\n url "{url}"\n sha256 "{sha}"\n end'
blocks.append((canonical.lower(), block))
# Normalize the resource name to its PEP 503 form (lowercase, runs of
# [-_.] collapsed to a single "-"). brew audit requires the `resource`
# name to match the normalized PyPI name, e.g. "ruamel.yaml" ->
# "ruamel-yaml", "Pygments" -> "pygments". URL/sha256 are unaffected.
res_name = re.sub(r"[-_.]+", "-", canonical).lower()
block = f' resource "{res_name}" do\n url "{url}"\n sha256 "{sha}"\n end'
blocks.append((res_name, block))

for _, block in sorted(blocks):
print(block)
Expand Down
Loading