Skip to content

Latest commit

 

History

History
84 lines (73 loc) · 2.52 KB

File metadata and controls

84 lines (73 loc) · 2.52 KB

Dev

Git hooks

poetry run task install_hooks
# ensures readme.md table is up to date

Tagging convention

major version tbd minor version when adding new tool patch version when fixing tool / installation

python install

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

shot notes

release 2.0.0 didn't work for a few reasons.

  1. 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
  2. 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

ruby install

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

debugging formula locally

  1. edit the formula

    brew edit $formula
    # e.g. brew edit shot, copy contents from ./shot.rb to shell
  2. 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
  3. reinstall

    brew reinstall $formula
    # e.g. brew reinstall shot

Additional info at https://docs.brew.sh/Python-for-Formula-Authors