poetry run task install_hooks
# ensures readme.md table is up to date
major version tbd minor version when adding new tool patch version when fixing tool / installation
Formula scaffold using poet
cd scripts
poetry install
poetry run poet -f $package
# copy output to new file Formula/$package.rb e.g.
# follow other files as example for required manual updates (description, version, test, etc.)
# example
poetry shell
cd ../../shot
poetry run build
poetry install
cd - # back to scripts dir
poetry run poet -f shot
# note $package doesn't need to be on pypi, just installed in current python environment.
# name sha etc will be wrong if not on pypi, but deps will be correct
release 2.0.0 didn't work for a few reasons.
- dataclasses was included in deps generated by poet, even though the package is only required for python <= 3.6.
similar to: pytorch/pytorch#46930 (comment)
resolved by removing dataclasses from shot.rb brew reinstall shot
failed because I was still using poetry build system instal of poetry-core.
see: python-poetry/poetry#3661 (comment)
resolved by changing to poetry-core build system and releasing 2.0.1
https://github.com/ConorSheehan1/shot/releases/tag/v2.0.1
Tests and linting
bundle install
bundle exec rubocop # --safe-auto-correct
bundle exec rspec
# note: tests are setup to ensure hosted tap works.
# note: can't use parallel_tests.
# Error: Another active Homebrew update process is already in progress.
# generate versions.yaml and update readme table
bundle exec ruby scripts/readme_yaml_cli.rb update_all
-
brew edit $formula # e.g. brew edit shot, copy contents from ./shot.rb to shell
-
install and run byebug at the point causing issues
def install Homebrew.install_gem_setup_path! "byebug" require 'byebug' byebug venv = virtualenv_create(libexec) venv.pip_install resources end
-
reinstall
brew reinstall $formula # e.g. brew reinstall shot
Additional info at https://docs.brew.sh/Python-for-Formula-Authors