1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-23 04:25:10 +03:00
pmbootstrap/pmb/parse
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 pmb: Use explicit re-exports (MR 2545) 2025-02-23 11:40:44 +01:00
_apkbuild.py pmb.parse._apkbuild: Use NonBugError for all errors 2025-07-06 21:15:31 +02:00
apkindex.py pmb.parse.apkindex: account for provider_priority when locating packages 2025-05-13 19:19:00 +02:00
arguments.py pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums 2025-07-11 00:13:26 +02:00
binfmt_info.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
bootimg.py bootimg: exynos: extract platform and subtype from dt.img header 2025-07-10 21:03:01 +02:00
cpuinfo.py Run ruff check --fix (MR 2357) 2024-07-16 00:26:35 +02:00
depends.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00
deviceinfo.py pmb: Use inspect.get_annotations() 2025-07-10 21:09:41 +02:00
kconfig.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00
kconfigcheck.py kconfig check: move rules to kconfigcheck.toml (MR 2333) 2024-06-30 18:04:31 +02:00
version.py pmb.parse.version: Use _ for "value" variable in validate() (MR 2516) 2025-01-02 16:45:01 +01:00