home-assistant-cli icon indicating copy to clipboard operation
home-assistant-cli copied to clipboard

Add support for installing via brew

Open niemyjski opened this issue 5 years ago • 14 comments

Would it be possible to add support for brew? It makes it much easier to install / maintain.

niemyjski avatar Feb 07 '19 14:02 niemyjski

if I knew how I would love to - want to contribute it ?

maxandersen avatar Feb 07 '19 16:02 maxandersen

I have a formula locally installed for brew. I will open a PR to add this into homebrew and one here for README instructions later this evening.

michaelwoods avatar Feb 11 '19 17:02 michaelwoods

cool @michaelwoods! does that formula just take the latest version and its dependencies available in pip or do we need to somehow update it on each release ? (wonder how other packages deal with that fun ;)

maxandersen avatar Feb 11 '19 20:02 maxandersen

The formula is updated on each release, it's not an ideal flow/pipeline but it keeps things relatively stable.

https://github.com/Homebrew/homebrew-core/pull/36915

michaelwoods avatar Feb 11 '19 22:02 michaelwoods

While hass-cli is available from Homebrew and works, it's currently pulling v0.5.0. That's missing the "state" command (at least) and some of the examples in the README fail. I switched to the pip3 installation method and got v0.6.0, which does have the missing command. The formula needs to be updated again.

rccoleman avatar Mar 25 '19 14:03 rccoleman

@michaelwoods you up for this ?

maxandersen avatar Mar 26 '19 02:03 maxandersen

Updated to 0.6.0 and I watched this repo for releases to help keep in sync.

https://github.com/Homebrew/homebrew-core/pull/38419

michaelwoods avatar Mar 27 '19 17:03 michaelwoods

Awesome, thanks!

rccoleman avatar Mar 27 '19 17:03 rccoleman

@michaelwoods 0.7.0 was released 10 days ago - I reckon you missed the notification. I've now automated releases of the cli to pypi so we'll hopefully see faster releases - if for nothing else to keep the dependencies matching homeassistant it self.

is there not any way we can automate the release to brew ?

maxandersen avatar May 26 '19 12:05 maxandersen

I've seen things like https://github.com/sloria/doitlive/blob/dev/release_homebrew.sh that might be useful for at least semi-automate the releases...but I have no idea how that will handle dependency updates.

maxandersen avatar May 26 '19 12:05 maxandersen

Automating would be great. Perhaps a Travis CI OSX instance (comes with homebrew already!) would work well. The process for updating is below, however I'm not sure if the manual merge step can be completed without a little scripting. The tools that I'm aware of unfortunately don't edit/update the formulas and only output blocks of text.

export PACKAGE=homeassistant-cli
export VERSION=0.7.0
pip install -U $PACKAGE
poet -f $PACKAGE > formula.new
brew edit $PACKAGE ### merge the changes from new to old file
brew upgrade $PACKAGE
brew test $PACKAGE
brew audit --strict --online $PACKAGE
cd $(dirname $(brew formula $PACKAGE))
git add ${PACKAGE}.rb
git commit -m "$PACKAGE $VERSION"
git push -f REMOTE_FORK master ### and then PR to Homebrew/homebrew-core

At the very least I suppose the build job's output could just be the new formulate template. brew bump-formula-pr may be an option, however it seems to want to send it right to github without being able to modify the resources section before that.

https://github.com/tdsmith/homebrew-pypi-poet https://docs.travis-ci.com/user/reference/osx/#using-macos

I've submitted the update PR to 0.7.0 to homebrew.

michaelwoods avatar Jun 27 '19 19:06 michaelwoods

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 26 '19 20:08 stale[bot]

stupid @stalebot :) marking pinned so not having to battle it

maxandersen avatar Aug 30 '19 23:08 maxandersen

FWIW, I just put up a PR for the upgrade to 0.9.1 with this command, after setting my github token so it could create the repos and PR as me:

brew bump-formula-pr --url https://files.pythonhosted.org/packages/ea/14/3e1f0327335a2a50409efbcdd35f4eea2961308a735bb1b1dd5b70ff6cec/homeassistant-cli-0.9.1.tar.gz homeassistant-cli

Just mentioning that here in case it helps with the automation!

shaver avatar May 14 '20 22:05 shaver