Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

krr --install-completion crash #57

Open
ganievs opened this issue May 31, 2023 · 7 comments
Open

krr --install-completion crash #57

ganievs opened this issue May 31, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@ganievs
Copy link

ganievs commented May 31, 2023

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
Screenshot 2023-05-31 at 12 24 31
Screenshot 2023-05-31 at 12 24 16

Desktop (please complete the following information):

  • OS: macOS on M2 chip
  • Version: Ventura
@LeaveMyYard
Copy link
Contributor

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

@LeaveMyYard LeaveMyYard added the bug Something isn't working label Jun 23, 2023
@ganievs
Copy link
Author

ganievs commented Jul 17, 2023

Hi there! Seems it's the same issue as described here: fastapi/typer#54.
And solution as described in fastapi/typer#54 (comment) is to create a python package

@ganievs
Copy link
Author

ganievs commented Jul 17, 2023

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 "python@3.11"

    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

@LeaveMyYard
Copy link
Contributor

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

@ganievs
Copy link
Author

ganievs commented Jul 27, 2023

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

@james-sullivan
Copy link

james-sullivan commented Jan 8, 2024

I'm currently having this same issue with version 1.6.0 installing it from homebrew
OS: Ventura 13.6.2
M2 Pro

@svlandeg
Copy link

svlandeg commented Jul 1, 2024

Hi! Could you check whether fastapi/typer#237 solves this issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants