1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-19 10:35:08 +03:00
pmbootstrap/pmb/commands
Newbyte 861de1e507
pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums
This allows us to get rid of some of the validation in sanity_checks()
as mypy handles this validation at "build time", and any typos in the
enum instantiation would be a runtime error rather than a silent
failure.

Additionally, it allows us to encode some of the behaviour of the
different output types into the type definition itself by using methods.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2642
(cherry picked from commit 7d2f055bcb)

pmb: Fix PmbArgs containing a string for output

While the annotations were changed to suggest that the output property
of PmbArgs contains a RunOutputType, at runtime it actually contained a
string because the argument parsing code hadn't been adapted to create a
RunOutputType. Fix this, and also change it to RunOutputTypeDefault as
while at it as that's more accurate.

Fixes 7d2f055bcb
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2644
2025-07-11 00:13:26 +02:00
..
__init__.py Remove "pmbootstrap repo_bootstrap" 2025-06-03 17:25:41 +02:00
aportgen.py pmb: Remove args from aportgen command (MR 2432) 2024-10-13 19:43:31 +02:00
base.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
flasher.py pmb.flasher: Fix passing command line flags (MR 2543) 2025-02-01 22:38:55 +01:00
index.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
kconfig.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
log.py pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
pkgrel_bump.py pmb: Migrate pkgrel_bump to Command (MR 2411) 2024-09-26 18:27:00 +02:00
pkgver_bump.py pmb.commands: Add pkgver_bump (MR 2415) 2024-09-30 12:45:21 +02:00
pull.py pmb.commands.pull: Remove bool return type from run() (MR 2490) 2024-12-19 10:09:22 +00:00
shutdown.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
test.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00