1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-12 19:09:56 +03:00
pmbootstrap/pmb
Newbyte 7fcbcdc19c
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
2025-07-11 00:13:26 +02:00
..
aportgen aportgen: device: set bootimg_qcdt_exynos_{platform,subtype} 2025-07-10 21:03:01 +02:00
build pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
chroot pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
ci pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
commands pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
config pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
core pmb: Use inspect.get_annotations() 2025-07-10 21:09:41 +02:00
data test: move all tests into separate module (MR 2551) 2025-02-13 01:28:20 +01:00
export export: drop support for flavor in export 2025-06-09 22:43:57 +02:00
flasher pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
helpers pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
install pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
meta pmb: Remove unused imports (MR 2545) 2025-02-23 11:40:40 +01:00
netboot pmb.netboot: Initialize chroot before checking path in chroot 2025-05-08 23:14:05 +02:00
parse pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
qemu pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
sideload pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
__init__.py Prepare 3.5.2 release 2025-07-02 20:16:02 +02:00
types.py pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00