Research-mind toolchains-universal-infrastructure-homebrew-formula-maintenance
Homebrew Formula Maintenance
install
source · Clone the upstream repo
git clone https://github.com/MacPhobos/research-mind
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/MacPhobos/research-mind "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/toolchains-universal-infrastructure-homebrew-formula-maintenance" ~/.claude/skills/macphobos-research-mind-toolchains-universal-infrastructure-homebrew-formula-mai && rm -rf "$T"
manifest:
.claude/skills/toolchains-universal-infrastructure-homebrew-formula-maintenance/skill.mdsource content
Homebrew Formula Maintenance
Overview
Use this workflow to keep Homebrew formulas in sync with PyPI releases for Python CLIs. The pattern in your taps is: update version + sha, refresh resource blocks when needed, run brew install/test/audit, then push the tap update (manually or via CI).
Quick Start (manual bump)
- Verify the PyPI release exists and grab the sdist URL + SHA256.
- Update the
andurl
in the formula.sha256 - Refresh
stanzas if the formula usesresource
.virtualenv_install_with_resources - Test:
+brew install --build-from-source
+brew test
.brew audit --strict - Update changelog/tag and push the tap repo.
Local Scripts You Already Use
homebrew-claude-mpm/scripts/update_formula.sh <version>- Verifies PyPI, updates url/sha, regenerates resources, optional brew test/audit.
homebrew-claude-mpm/scripts/generate_resources.py- Emits Python dependency
blocks from PyPI.resource
- Emits Python dependency
homebrew-claude-mpm/scripts/test_formula.sh- End-to-end brew install/test/audit/style.
mcp-vector-search/scripts/update_homebrew_formula.py- End-to-end tap update with
,--dry-run
,--version
and--tap-repo-path
.HOMEBREW_TAP_TOKEN
- End-to-end tap update with
Standard Workflow
1. Confirm PyPI Release
- Check the sdist is available and capture URL/SHA.
- Typical command:
.curl -s https://pypi.org/pypi/<package>/<version>/json
2. Update Formula URL + SHA
- Replace
andurl
insha256
.Formula/<name>.rb - Keep the formula version implicit via the sdist URL (your taps do this).
3. Refresh Resources (Python Virtualenv Formula)
If the formula uses
Language::Python::Virtualenv and virtualenv_install_with_resources:
- Regenerate
stanzas after dependency changes.resource - Use
or equivalent; review output before pasting.generate_resources.py
4. Test and Audit
Run these in the tap repo:
brew install --build-from-source ./Formula/<name>.rb brew test <name> brew audit --strict ./Formula/<name>.rb brew style ./Formula/<name>.rb
5. Commit and Push
- Update
if the tap repo tracks releases.CHANGELOG.md - Commit, tag, and push as required by the tap workflow.
Formula Patterns (From Your Taps)
Full Virtualenv Formula (claude-mpm)
include Language::Python::Virtualenvvirtualenv_install_with_resources- Large
blocks to pin dependenciesresource
uses CLI commands liketest do
and subcommands--version
Minimal Venv Formula (mcp-vector-search)
- Create venv explicitly and
pip install -v buildpath
for CLI entrypointbin.install_symlink- Minimal
usestest do
and--version--help
CI Automation Pattern
Your GitHub Actions workflow for Homebrew updates follows this flow:
- Trigger on tag or
after CI succeeds.workflow_run - Run
.scripts/update_homebrew_formula.py - Require
(and optionalHOMEBREW_TAP_TOKEN
).HOMEBREW_TAP_REPO - On failure, open an issue with manual update steps.
Troubleshooting
- PyPI release missing: verify tag push and publish step completed.
- SHA mismatch: re-fetch sdist SHA from PyPI JSON.
- brew audit failures: confirm dependency resource blocks match the sdist and
dependency is present.python@x.y - Install failures: verify
dependency andpython@x.y
usage.virtualenv_install_with_resources
Related Skills
toolchains/universal/infrastructure/github-actionstoolchains/universal/infrastructure/docker