krr
krr copied to clipboard
krr --install-completion crash
Describe the bug
krr --install-completion
crashes when krr was install via homebrew
To Reproduce Steps to reproduce the behavior:
$ brew tap robusta-dev/homebrew-krr
$ brew install krr
$ krr --install-completion
Expected behavior Shell completion installed successfuly
Screenshots
Desktop (please complete the following information):
- OS: macOS on M2 chip
- Version: Ventura
Hey, @ganievs
Thanks for finding the bug. Completion feature is provided by the Typer library.
We will try to investigate it. If it will require too much to fix - maybe we will just remove this from the CLI
Hi there! Seems it's the same issue as described here: https://github.com/tiangolo/typer/issues/54. And solution as described in https://github.com/tiangolo/typer/issues/54#issuecomment-601219336 is to create a python package
You can publish a package resulting from poetry build
and use it in the Homebrew formula.
$ poetry build
$ sha256 dist/robusta_krr-1.3.2.dev0.tar.gz
The Formula's file will look like that:
class Krr < Formula
include Language::Python::Virtualenv
desc "Kubernetes Resource Recommender by Robusta"
homepage "https://github.com/robusta-dev/krr"
url "https://github.com/ganievs/krr/releases/download/test-homebrew/robusta_krr-1.3.2.dev0.tar.gz"
version "1.3.2"
sha256 "75850810d5083ee761662511e0ceefe99e2fad43feae8e53cd393c40e833bf21"
depends_on "[email protected]"
def install
virtualenv_install_with_resources
end
test do
system bin/"krr", "version"
end
end
I did some tests on my fork and it works well on both Mac and Linux. Test release: https://github.com/ganievs/krr/releases/tag/test-homebrew Homebrew Formula with it: https://github.com/ganievs/homebrew-krr
The only issue is that we are building a standalone with pyinstaller to avoid potential dependancy issues But I will think on your solution, thank you for your work
The only think is I am a bit afraid on introducing such a big change for fixing a small problem with --install-completion
.
I will come back to this issue in the future after more important stuff is fixed and I will implement your solution. Thanks again
Sure, No worries!
small problem with --install-completion
I just wanted to highlight the current packaging way might produce some similar bugs https://stackoverflow.com/questions/22241420/execution-of-python-code-with-m-option-or-not
I'm currently having this same issue with version 1.6.0 installing it from homebrew OS: Ventura 13.6.2 M2 Pro
Hi! Could you check whether https://github.com/tiangolo/typer/pull/237 solves this issue for you?