zephyrproject-rtos/west

Improvement: WestCommandsType should be a class

Open

#959 aperta il 6 giu 2026

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Python (157 fork)auto 404
good first issue

Metriche repository

Star
 (350 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

See https://github.com/zephyrproject-rtos/west/pull/920#discussion_r3367818364

Actually, would it be simpler and clearer to just promote WestCommandsType to some very basic but actual Python class?

I did consider this, and gave it a brief try, but it felt like a much more invasive refactoring than I was comfortable doing, and that would further explode the size of this #920 PR (which as you said has evolved quite a bit). It most likely should have been a class from the very start tbh - _west_commands_list feels like a constructor, _west_commands_maybe_delist feels like a string representation, _west_commands_merge would be an elegant iadd....

Make sure to include the _west_commands_manifest_dirs in the class somehow - it could be that a subclass of dict would be most suitable for WestCommandsType.

Guida contributor