Skip to content

packaging: fix Homebrew formula audit (dep order + resource name)#3

Merged
ulmentflam merged 1 commit into
mainfrom
fix/homebrew-formula-audit
May 27, 2026
Merged

packaging: fix Homebrew formula audit (dep order + resource name)#3
ulmentflam merged 1 commit into
mainfrom
fix/homebrew-formula-audit

Conversation

@ulmentflam

@ulmentflam ulmentflam commented May 27, 2026

Copy link
Copy Markdown
Owner

Why

The release brew-bump job copies packaging/distribution/autosentry.rb into the tap and rewrites only url/sha256. So any FormulaAudit issue in this template re-breaks the tap's brew test-bot --only-tap-syntax on every release. The v0.7.4 bump did exactly that — it reverted hand-fixes that had been applied directly in the tap, turning the tap's CI red again:

FormulaAudit/DependencyOrder: `dependency "rust"` should be before `dependency "python@3.13"`
Stable/HEAD resource "ruamel.yaml": `resource` name should be 'ruamel-yaml'

Fix (at the source, so it stops recurring)

  • autosentry.rb: order rust (:build) before python@3.13 (normal) per FormulaAudit/DependencyOrder; rename resource "ruamel.yaml""ruamel-yaml" to match the normalized PyPI name.
  • gen_resources.py: emit PEP 503-normalized resource names (lowercase, [-_.]+-), so a future regeneration can't reintroduce names like ruamel.yaml. URL/sha256 are unaffected.

Validated: ruby -c + py_compile pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated Homebrew formula dependencies: added Rust and Python 3.13 build requirements.
    • Updated package dependency naming conventions to align with PyPI standards for improved package resolution and compatibility.

Review Change Stack

The brew-bump release job copies packaging/distribution/autosentry.rb to the
tap and rewrites url/sha256, so any FormulaAudit issue in this template
re-breaks the tap's `brew test-bot --only-tap-syntax` on every release. The
v0.7.4 bump did exactly that, reverting the tap's hand-fixes. Fix at the source:

- autosentry.rb: order `rust` (build) before `python@3.13` (normal) per
  FormulaAudit/DependencyOrder; rename `resource "ruamel.yaml"` ->
  `"ruamel-yaml"` to match the normalized PyPI name.
- gen_resources.py: emit PEP 503-normalized resource names (lowercase,
  [-_.]+ -> "-") so regeneration can't reintroduce names like "ruamel.yaml".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f85758be-15c6-4870-a8ca-59a7ca041f2a

📥 Commits

Reviewing files that changed from the base of the PR and between 75eae33 and 096cc70.

📒 Files selected for processing (2)
  • packaging/distribution/autosentry.rb
  • packaging/distribution/gen_resources.py

📝 Walkthrough

Walkthrough

This PR updates Homebrew packaging by implementing PEP 503 resource name normalization in the generator and updating the formula accordingly. The generator now normalizes PyPI package names to canonical form, and the formula is adjusted to use the normalized ruamel-yaml resource name plus explicit build dependencies.

Changes

Resource name normalization and formula updates

Layer / File(s) Summary
PEP 503 resource name normalization
packaging/distribution/gen_resources.py
Generator imports re module and applies PEP 503 normalization to package names when generating resource blocks: collapses runs of -_. into single - and lowercases, using normalized names for both resource declaration and sorting.
Homebrew formula dependency and resource updates
packaging/distribution/autosentry.rb
Formula declares explicit rust build dependency with python@3.13 and renames the resource from ruamel.yaml to ruamel-yaml to align with generator normalization output.

Possibly related PRs

  • ulmentflam/autosentry#1: The prior PR introducing the Homebrew tap formula and dependency-resource generator; this PR refines the generator's resource naming strategy and applies it to the formula.

Poem

🐰 The names now normalize with hyphens so clear,
PEP 503 style brings order and cheer!
Ruamel's reformed, dependencies neat,
Our package is ready, the build is complete! 📦✨

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: fixing Homebrew formula audit issues through dependency reordering and resource name normalization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/homebrew-formula-audit

Comment @coderabbitai help to get the list of available commands and usage tips.

@ulmentflam ulmentflam merged commit f1c4e04 into main May 27, 2026
12 checks passed
@ulmentflam ulmentflam deleted the fix/homebrew-formula-audit branch May 27, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant