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

[BUG] TypeError: Command.__init__() got an unexpected keyword argument 'rich_markup_mode' #18

Closed
henryiii opened this issue Jul 29, 2022 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@henryiii
Copy link
Contributor

Describe the bug

This doesn't work anymore.

To Reproduce

Steps to reproduce the behavior:

  1. Use the command pipx run 'pypi-command-line'.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ <string>:3 in <module>                                                                           │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ __annotations__ = {}                                                                         │ │
│ │    __builtins__ = <module 'builtins' (built-in)>                                             │ │
│ │         __doc__ = None                                                                       │ │
│ │      __loader__ = <class '_frozen_importlib.BuiltinImporter'>                                │ │
│ │        __name__ = '__main__'                                                                 │ │
│ │     __package__ = None                                                                       │ │
│ │        __spec__ = None                                                                       │ │
│ │        pypi_cli = <module 'pypi_cli' from                                                    │ │
│ │                   '/Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/… │ │
│ │             sys = <module 'sys' (built-in)>                                                  │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/site-packages/pypi_cli/_ │
│ _main__.py:1463 in run                                                                           │
│                                                                                                  │
│   1460                                                                                           │
│   1461 def run():                                                                                │
│   1462 │   """Run the CLI."""                                                                    │
│ ❱ 1463 │   app()                                                                                 │
│   1464                                                                                           │
│   1465                                                                                           │
│   1466 if __name__ == "__main__":                                                                │
│                                                                                                  │
│ /Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/site-packages/typer/main │
│ .py:328 in __call__                                                                              │
│                                                                                                  │
│ /Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/site-packages/typer/main │
│ .py:311 in __call__                                                                              │
│                                                                                                  │
│ /Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/site-packages/typer/main │
│ .py:350 in get_command                                                                           │
│                                                                                                  │
│ /Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/site-packages/typer/main │
│ .py:332 in get_group                                                                             │
│                                                                                                  │
│ /Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/site-packages/typer/main │
│ .py:483 in get_group_from_info                                                                   │
│                                                                                                  │
│ /Users/henryschreiner/.local/pipx/.cache/f20bc60165213c2/lib/python3.10/site-packages/typer/main │
│ .py:579 in get_command_from_info                                                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: Command.__init__() got an unexpected keyword argument 'rich_markup_mode'

Information (please try to complete the following information):

  • OS : macOS
  • Terminal : iTerm
  • Shell : fish
  • OS Version : latest
  • Python Version : 3.10
  • Package Versions : latest (via pipx)

Additional context

Possibly a rich or typer update? Typer is 0.6.1 and rich 12.5.1.

@henryiii henryiii added the bug Something isn't working label Jul 29, 2022
@henryiii
Copy link
Contributor Author

Forcing typer<0.6 does seem to fix the issue. Maybe it's a clash with the native Rich support in typer 0.6 now?

@wasi-master
Copy link
Owner

wasi-master commented Aug 4, 2022

Oh sorry I was in vacation, looking into it now

@wasi-master
Copy link
Owner

I've temporarily pinned typer to 0.6 because I've tried a lot but still couldn't fix the issue. I know that it is because of my custom typer subclass but I cannot really remove that because it is needed for a lot of the smart features. I'll look at it maybe more in a few days

@alextremblay
Copy link

Hello, Any update on this?

I installed an editable copy of your project, replaced your app = PypiTyper() line with just a app = typer.Typer(), and the application now works. all the commands I've tested work, nothing appears to be broken.

What smart features does your typer subclass provide?

@henryiii
Copy link
Contributor Author

henryiii commented Aug 19, 2022

I think it provided Rich colors but that was added to Typer itself in the last release. (Not sure though) (Edit: I mean I think this is what was added that was conflicting)

@wasi-master
Copy link
Owner

@alextremblay mainly the error handling and aliases

@workflowsguy
Copy link

Hello,

I just installed 1.6.17 and also encounter this issue.

@wasi-master
Copy link
Owner

@workflowsguy okay I'll look into it again

@henryiii
Copy link
Contributor Author

henryiii commented Nov 9, 2022

Great, thanks! By the way, have you looked into the JSON api for PyPI that was released recently? It's easy to get a lot of info quickly with that.

@wasi-master
Copy link
Owner

@henryiii No I haven't, thanks, I'll look into it now :)

@henryiii
Copy link
Contributor Author

henryiii commented Nov 9, 2022

I've used it a bit programmatically via https://pypi.org/project/pypi-json if that's interesting to check out.

@wasi-master
Copy link
Owner

@henryiii thanks, but upon further inspection, it seems as though I am already using it 👍

@henryiii
Copy link
Contributor Author

henryiii commented Nov 9, 2022

Great! Was thinking it was pretty new, but not sure how new (or if it was available before but less documented / used).

@alextremblay
Copy link

Awesome, thank you @wasi-master!

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