Closed pawamoy closed 1 week ago
Looks like the class variable is shifting everything:
(look at short flags in the watch pane, and the subcommand being assigned to _CONFIG
in the variables pane)
My investigation tells me that DataclassField
should maybe use dataclasses.fields(typ)
instead of typ.__dataclasses_fields__
, as the former correctly ignores classvars:
"_CONFIG" in [f.name for f in dataclasses.fields(command.cmd_cls)] # False
"_CONFIG" in command.cmd_cls.__dataclass_fields__ # True
https://docs.python.org/3/library/dataclasses.html#dataclasses.fields
Just tried the fix and it works :slightly_smiling_face: If you believe that is a proper solution, I'm happy to send a PR.
It seems to pass tests, i cannot for the life of me tell why I would have used that field instead of the fields
function...
Yea feel free to send a PR! If it's accompanied by a classvar test and a CHANGELOG
entry, feel free to also bump the patch version and i can release it directly. (but i can also follow up with those, or the pr myself. up to you!)
Working on it!
I'll leave the changelog update and version bump to you this time :smile: