Python utility library
  • Python 98.5%
  • Makefile 1.3%
  • Shell 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jan Lindemann 63c0ed3951
jwutils.Cmd.add_subcommands(): Collect only Cmd
This commit fixes tightening type check fallout.

add_subcommands() with a string pattern collects every class of the calling
module whose name matches the pattern. inspect.getmembers() yields plain
objects, so the unannotated collection list is inferred as list[object],
which is not compatible with the declared list[type[Cmd]] parameter type,
and make check fails on it.

Annotate the collection list as list[type[Cmd]] and narrow it to subclasses
of Cmd via issubclass(). This makes the implementation match the declared
signature and stops classes lacking the Cmd interface from being registered
as subcommands, where they would break later when instantiated and treated
as Cmd in __add_cmd_to_parser().

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
2026-09-13 13:47:22 +02:00
.github/workflows ci.yaml: enable-email-notifications: true 2026-06-08 14:55:11 +02:00
bin Rename the MODDIR makefile variable to JWBDIR 2019-06-29 23:32:20 +02:00
conf Rename the MODDIR makefile variable to JWBDIR 2019-06-29 23:32:20 +02:00
make stree.StringTree: Add unit tests 2026-08-12 23:10:12 +00:00
scripts Add missing async keywords to jwutils.Cmd.run() reimplementations 2020-02-10 19:49:46 +01:00
src jwutils.Cmd.add_subcommands(): Collect only Cmd 2026-09-13 13:47:22 +02:00
test load_yaml: _load_yaml(): Skip empty included documents 2026-08-27 19:03:09 +02:00
.gitignore .gitignore: Update 2: Run "make gitignore" 2026-09-13 13:47:08 +02:00
HASH Release 1.0.0-54@suse-tumbleweed/x86_64 2026-08-29 09:03:02 +00:00
Makefile Makefile: Include py-topdir.mk 2026-06-12 04:55:47 +02:00
RELEASES Release 1.0.0-54@suse-tumbleweed/x86_64 2026-08-29 09:03:02 +00:00
VERSION Start version: 1.0.0-54 2026-08-29 07:22:35 +00:00