A Homebrew tap is a custom repository containing Homebrew formulas. To make lore-book installable via Homebrew, follow these steps:
Create a new GitHub repository named homebrew-lore with this structure:
homebrew-lore/
├── Formula/
│ └── lore.rb
├── README.md
└── .github/workflows/
└── tests.yml
Copy the Formula/lore.rb from this repository to your new tap repository.
The formula contains a placeholder SHA256. Once your package is published to PyPI, get the correct SHA256:
# After publishing lore-book to PyPI
python3 -c "import urllib.request, hashlib; data = urllib.request.urlopen('https://files.pythonhosted.org/packages/source/l/lore-book/lore-book-0.1.0.tar.gz').read(); print(hashlib.sha256(data).hexdigest())"Update the sha256 value in Formula/lore.rb.
Create a README.md in the tap repository:
# homebrew-lore
Homebrew tap for lore-book.
## Installation
```bash
brew tap cptplastic/lore
brew install lorelore --help
### Step 5: Publish to PyPI
Make sure lore-book is published to PyPI first:
```bash
# From lore-book directory
pip install build
python -m build
twine upload dist/*
brew tap cptplastic/lore https://github.com/cptplastic/homebrew-lore
brew install loreOr more simply (if tap is public):
brew install cptplastic/lore/loreCreate .github/workflows/tests.yml in your tap repo:
name: Homebrew Tests
on: [push, pull_request]
jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Test formula
run: |
brew install --verbose --build-from-source --HEAD ./Formula/lore.rb
brew test lore
brew audit --formula lore.rb