home-assistant-ecosystem / home-assistant-cli

:computer: Command-line tool for Home Assistant
Other
437 stars 68 forks source link

`No such command 'completion'` for homeassistant-cli 0.9.4 build #367

Closed chenrui333 closed 2 years ago

chenrui333 commented 3 years ago
==> /opt/homebrew/Cellar/homeassistant-cli/0.9.4/bin/hass-cli completion bash
Usage: hass-cli [OPTIONS] COMMAND [ARGS]...
Try 'hass-cli --help' for help.

Error: No such command 'completion'.

relates to Homebrew/homebrew-core#79691

fabaff commented 3 years ago

It's came up for the NixOS packages as well.

The completion needs to be ported to work with click > 8.0.

MostHated commented 3 years ago

I ran into this just now when I installed via pip on Pop_OS 20.10

onkelbeh commented 3 years ago

I tried the fix from https://github.com/home-assistant-ecosystem/home-assistant-cli/pull/369, seems not to work for me:

root@g18-hasstest:~ # bash --version
GNU bash, Version 5.1.8(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder jünger <http://gnu.org/licenses/gpl.html>

Dies ist freie Software. Sie darf verändert und verteilt werden.
Es wird keine Garantie gewährt, soweit das Gesetz es zulässt.
root@g18-hasstest:~ # source <(_HASS_CLI_COMPLETE=bash_source hass-cli)
error: RuntimeError: Couldn't detect Bash version, shell completion is not supported.
root@g18-hasstest:~ #

Perhaps @lwille could take a look.

Seems to depend on locale, works with C.utf8 & POSIX, the others fail.

root@g18-hasstest:~ # eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   C.utf8
  [3]   de_DE.utf8 *
  [4]   en_US.utf8
  [5]   POSIX
  [ ]   (free form)
root@g18-hasstest:~ # eselect locale set 2
Setting LANG to C.utf8 ...
Run ". /etc/profile" to update the variable in your shell.
root@g18-hasstest:~ # . /etc/profile
root@g18-hasstest:~ # source <(_HASS_CLI_COMPLETE=bash_source hass-cli)
root@g18-hasstest:~ #
onkelbeh commented 3 years ago

Not sure if this isn't an issue for click, because the version check is done in click/shell_completion.py. Please let me know if this is adressed wrong here.

lwille commented 2 years ago

Sorry for not following up on this - I gave up at some point. Closed my draft PR.

johntdyer commented 2 years ago

I am running into the same issue on 0.9.4

fharper commented 2 years ago

Same problem with 0.9.4 also.

chenrui333 commented 2 years ago

Any maintainer seeing this issue?

cunderw commented 2 years ago

Seeing the same issue here on macOS.

ScottG489 commented 2 years ago

Running into this via pip install on Ubuntu 20.04 on version 0.9.4.

fabaff commented 2 years ago

Should be fixed with #385

chenrui333 commented 1 year ago

I am still seeing the similar error in the 0.9.6 build

  Error: Failure while executing; `\{\"SHELL\"=\>\"bash\"\} /opt/homebrew/Cellar/homeassistant-cli/0.9.6/bin/hass-cli completion bash` exited with 2. Here's the output:

build log, https://github.com/Homebrew/homebrew-core/actions/runs/3728798001/jobs/6324164107

chenrui333 commented 1 year ago

Also @fabaff, can you help with this pypi artifact issue as well?