Textualize / trogon

Easily turn your Click CLI into a powerful terminal application
MIT License
2.46k stars 56 forks source link

Error: F1 - About crashes because `Package 'textual.widgets' has no class '__wrapped__'` #57

Closed jeertmans closed 1 day ago

jeertmans commented 1 year ago

Hello!

When trying to add a TUI to my program, see https://github.com/jeertmans/manim-slides/pull/249, the TUI crashes when pressing F1. The issue seems to also occur during tests, see logs.

I have attached the full error traceback below.

Thanks!

```bash ╭─────────────── Traceback (most recent call last) ────────────────╮ │ /home/eertmans/.cache/pypoetry/virtualenvs/manim-slides-M-PeeMP- │ │ -py3.10/lib/python3.10/site-packages/trogon/trogon.py:138 in │ │ action_about │ │ │ │ 135 │ │ self.app.exit() │ │ 136 │ │ │ 137 │ def action_about(self) -> None: │ │ ❱ 138 │ │ from .widgets.about import AboutDialog │ │ 139 │ │ │ │ 140 │ │ self.app.push_screen(AboutDialog()) │ │ 141 │ │ │ │ ╭──────── locals ─────────╮ │ │ │ self = CommandBuilder() │ │ │ ╰─────────────────────────╯ │ │ │ │ /home/eertmans/.cache/pypoetry/virtualenvs/manim-slides-M-PeeMP- │ │ -py3.10/lib/python3.10/site-packages/trogon/widgets/about.py:8 │ │ in │ │ │ │ 5 from textual.binding import Binding │ │ 6 from textual.containers import Center, Vertical │ │ 7 from textual.screen import ModalScreen │ │ ❱ 8 from textual.widgets import Button, Static │ │ 9 from textual.widgets._button import ButtonVariant │ │ 10 │ │ 11 │ │ │ │ ╭──────────────────────── locals ────────────────────────╮ │ │ │ Binding = │ │ │ │ Center = │ │ │ │ ComposeResult = typing.Iterable[textual.widget.Widget] │ │ │ │ ModalScreen = │ │ │ │ Text = │ │ │ │ TextType = typing.Union[str, ForwardRef('Text')] │ │ │ │ Vertical = │ │ │ ╰────────────────────────────────────────────────────────╯ │ │ │ │ in feature_imported:61 │ │ │ │ in feature_imported:137 │ │ │ │ in _mod_uses_pyside:148 │ │ │ │ /usr/lib/python3.10/inspect.py:1139 in getsource │ │ │ │ 1136 │ The argument may be a module, class, method, function │ │ 1137 │ or code object. The source code is returned as a sin │ │ 1138 │ OSError is raised if the source code cannot be retrie │ │ ❱ 1139 │ lines, lnum = getsourcelines(object) │ │ 1140 │ return ''.join(lines) │ │ 1141 │ │ 1142 # --------------------------------------------------- cla │ │ │ │ ╭─────────────────────────── locals ───────────────────────────╮ │ │ │ object = = recursion_l │ │ │ │ ╭─────────────────────────── locals ───────────────────────────╮ │ │ │ _is_wrapper = ._is_wrapper at │ │ │ │ 0x7f0d12e38ee0> │ │ │ │ f =
daneah commented 2 days ago

Hey @jeertmans, can you confirm whether this is still an issue using trogon==0.6.0?

jeertmans commented 2 days ago

I did bump the package: the TUI works, except for one command present, that fails when selecting it (TypeError: '<' not supported between instances of 'NoneType' and 'NoneType').

See error logs attached. But I guess this is another issue?

I have updated https://github.com/jeertmans/manim-slides/pull/249 to you can checkout it if you want to test locally.

logs.txt

daneah commented 1 day ago

Yep, I think that new error looks suspiciously like textualize/trogon#56!

jeertmans commented 1 day ago

Yes instead, I forgot I posted that issue too 😅