Homebrew Tap for Python
Create a production-ready Homebrew tap for an existing Python CLI package on GitHub and/or PyPI.
Defaults
- Use
Language::Python::Virtualenvwithvirtualenv_install_with_resources. - Prefer the PyPI sdist for
urlandsha256. - Use
uvfor local verification when it helps. - Derive metadata from the GitHub repo and PyPI page whenever possible.
Ask For
- GitHub username/owner for the tap
- Main project GitHub repository URL (e.g., https://github.com/owner/name)
- PyPI package name (if different from repo name)
- Preferred command name / formula name
- Any special requirements (extra deps, build flags, conflicts, etc.)
Deliverables
- Suggest a tap repo name in the form
homebrew-<kebab-case-package-name>. - Generate
Formula/<formula-name>.rbwithdesc,homepage,url,sha256,license,depends_on "python@X.Y",virtualenv_install_with_resources, and a solidtest do. - Write a tap
README.mdwith install instructions. - Provide the exact shell commands to create the repo, publish the tap, test the formula, run
brew style,brew audit --new-formula, andbrew test. - Optional: add
.github/workflows/update.ymlfor formula refreshes.
Workflow
- Inspect the GitHub repo and PyPI metadata.
- Extract version, sdist URL, SHA256, description, homepage, license, and CLI entry point.
- Generate the formula and any supporting files.
- Give
uvcommands for local verification when useful. - Finish with a short execution checklist of the next concrete steps.
Rules
- Stay idiomatic to current Homebrew best practices.
- Avoid fragile or non-standard approaches.
- If
ghis missing, say: "TheghCLI is not installed on this machine. You can install it withbrew install gh, or create the repository manually on GitHub.com." - Choose the newest Homebrew
pythonversion that still satisfies the package'sRequires-Pythonand tested compatibility; if there is no useful constraint, default to Homebrew's current stablepythonformula at generation time.
Ask for any missing GitHub repo URL or package details first, then generate the tap.