Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
49.69k stars 1.73k forks source link

[BUG] Kwargs unpacking issue to the Style class (not sure if other class affected) #3465

Closed AntsForBreakfast closed 3 months ago

AntsForBreakfast commented 3 months ago

When trying to unpack style params to a Style class as kwargs i get meta error but meta is last parameter. Not sure why it happens since kwargs should not care about position

Provide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.

style_params = {}
Style(**style_params)

What platform (Win/Linux/Mac) are you running on? What terminal software are you using? Linux Arch, Kitty terminal

github-actions[bot] commented 3 months ago

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

willmcgugan commented 3 months ago

Can you paste the traceback.

AntsForBreakfast commented 3 months ago

Can you paste the traceback.

Sorry been busy, will do today at evening

AntsForBreakfast commented 3 months ago

After some testing it seem to be working and its linter issue. It creates Style object but linter says: Argument of type "Color" cannot be assigned to parameter "meta" of type "Dict[str, any] | None"

AntsForBreakfast commented 3 months ago

Writing meta = None fixes the issues

willmcgugan commented 3 months ago

I think this is actually an error in the linter.

github-actions[bot] commented 3 months ago

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual