qtile check help

223 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Justine Smithies

ungelesen,
30.09.2021, 16:56:2730.09.21
an qtile-dev
 My Qtile seems to be running as expected but i just ran qtile check and got 11 errors which I cannot seem to see what's wrong in my config.py 
Would someone kindly take a peek at my config and see if it's anything to worry about and or explain what I need to change and why ???


checking qtile config file /home/justine/.config/qtile/config.py
tmp/tmpe670miy_/config.py:372: error: Argument 1 to "Group" has incompatible type "object"; expected "str"
tmp/tmpe670miy_/config.py:372: error: Argument "matches" to "Group" has incompatible type "object"; expected "Optional[List[Match]]"
tmp/tmpe670miy_/config.py:373: error: Argument 2 to "Key" has incompatible type "object"; expected "str"
tmp/tmpe670miy_/config.py:373: error: Invalid index type "object" for "InteractiveCommandClient"; expected type "Union[str, int]"
tmp/tmpe670miy_/config.py:374: error: Argument 2 to "Key" has incompatible type "object"; expected "str"
tmp/tmpe670miy_/config.py:390: error: Argument 1 to "Floating" has incompatible type "**Dict[str, object]"; expected "Optional[List[Match]]"
tmp/tmpe670miy_/config.py:417: error: Item "None" of "Optional[Any]" has no attribute "cmd_spawn"
tmp/tmpe670miy_/config.py:437: error: Item "None" of "Optional[Any]" has no attribute "cmd_spawn"
tmp/tmpe670miy_/config.py:439: error: Item "None" of "Optional[Any]" has no attribute "cmd_spawn"
tmp/tmpe670miy_/config.py:441: error: Item "None" of "Optional[Any]" has no attribute "cmd_spawn"
tmp/tmpe670miy_/config.py:443: error: Item "None" of "Optional[Any]" has no attribute "cmd_spawn"
Found 11 errors in 1 file (checked 1 source file)
config file type checking failed: Command '['mypy', '--python-version=3.8', '/tmp/tmpe670miy_/config.py']' returned non-zero exit status 1.

Tycho Andersen

ungelesen,
30.09.2021, 18:12:3530.09.21
an qtil...@googlegroups.com
On Thu, Sep 30, 2021 at 01:56:27PM -0700, Justine Smithies wrote:
> My Qtile seems to be running as expected but i just ran qtile check and
> got 11 errors which I cannot seem to see what's wrong in my config.py
> Would someone kindly take a peek at my config and see if it's anything to
> worry about and or explain what I need to change and why ???

I think in general "if it ain't broke don't fix it", but,

> config.py
> <https://github.com/justinesmithies/qtile-dotfiles/blob/master/.config/qtile/config.py>
>
>
> checking qtile config file /home/justine/.config/qtile/config.py
> tmp/tmpe670miy_/config.py:372: error: Argument 1 to "Group" has
> incompatible type "object"; expected "str"
> tmp/tmpe670miy_/config.py:372: error: Argument "matches" to "Group" has
> incompatible type "object"; expected "Optional[List[Match]]"

For these, they are from lines like,



workspaces = [
{"name": " ₁", "key": "1", "matches": [Match(wm_class='firefox')]},
{"name": " ₂", "key": "2", "matches": [Match(wm_class='kitty'), Match(wm_class='ranger')]},
...
]

...

groups.append(Group(workspace["name"], matches=matches, layout="monadtall"))

mypy unifies to a type of dict[str, object] for this, because some values have
type str, and some things resolve to List[Match]. That is, mypy can't see past
heterogeneous dictionaries.

That's fine, but it will result in these kinds of errors (and potentially
runtime errors if you use workspace["name"] where you mean
workspace["matches"], etc).

> tmp/tmpe670miy_/config.py:373: error: Argument 2 to "Key" has incompatible
> type "object"; expected "str"
> tmp/tmpe670miy_/config.py:373: error: Invalid index type "object" for
> "InteractiveCommandClient"; expected type "Union[str, int]"
> tmp/tmpe670miy_/config.py:374: error: Argument 2 to "Key" has incompatible
> type "object"; expected "str"

seems like the same here.

> tmp/tmpe670miy_/config.py:390: error: Argument 1 to "Floating" has
> incompatible type "**Dict[str, object]"; expected "Optional[List[Match]]"

This seems like the bug that has been reported a lot:
https://github.com/qtile/qtile/issues/2827

> tmp/tmpe670miy_/config.py:417: error: Item "None" of "Optional[Any]" has no
> attribute "cmd_spawn"
> tmp/tmpe670miy_/config.py:437: error: Item "None" of "Optional[Any]" has no
> attribute "cmd_spawn"
> tmp/tmpe670miy_/config.py:439: error: Item "None" of "Optional[Any]" has no
> attribute "cmd_spawn"
> tmp/tmpe670miy_/config.py:441: error: Item "None" of "Optional[Any]" has no
> attribute "cmd_spawn"
> tmp/tmpe670miy_/config.py:443: error: Item "None" of "Optional[Any]" has no
> attribute "cmd_spawn"

This seems like it is just a bug with qtile check that I couldn't figure out
how to fix: https://github.com/qtile/qtile/issues/2274#issuecomment-789332666

Tycho

Justine Smithies

ungelesen,
30.09.2021, 18:24:1930.09.21
an qtil...@googlegroups.com
Thank you so much Tycho for your in depth explanation. I like that comment "I it ain't broke, don't fix it" ;)

Justine

--
You received this message because you are subscribed to a topic in the Google Groups "qtile-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qtile-dev/rfQk9ovvuUw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qtile-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qtile-dev/YVY2TAAhbBDE%2B2nv%40cisco.
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten