binman: Fix typing for python >= 3.7
PATCH v3 1/1 binman: Fix typing for python >= 3.7
To get the [] annotation working with python 3.7 and 3.8, import annotations.
---
Changes in v3:
- drop the deprecated and soon-to-be-removed typing package needed for
python 3.6 and 3.5 support. Instead use __future__ which is supported
by python >= 3.7
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- drop newline changes
- Link to v1: https://lore.kernel.org/r/[email protected]
--- tools/binman/etype/cbfs.py | 1 + tools/binman/etype/mkimage.py | 1 + tools/binman/etype/section.py | 1 + 3 files changed, 3 insertions(+)
tools/binman/etype/cbfs.py +1 -0
@@ -5,6 +5,7 @@ # Entry-type module for a Coreboot Filesystem (CBFS) # +from __future__ import annotations from collections import OrderedDict from binman import cbfs_util
tools/binman/etype/mkimage.py +1 -0
@@ -5,6 +5,7 @@ # Entry-type module for producing an image using mkimage # +from __future__ import annotations from collections import OrderedDict from binman.entry import Entry
tools/binman/etype/section.py +1 -0
@@ -8,6 +8,7 @@ Sections are entries which can contain other entries. This allows hierarchical images to be created. """ +from __future__ import annotations from collections import OrderedDict import concurrent.futures import re
---
base-commit: 6bb0679377abb01a82db1ce69b5bf1d40aa02ace
change-id: 20250710-binman-typing-fix-a207bed6416b
Best regards,
Signature · 1 line
Yannic Moog <[email protected]>
Quoted 65 lines · Yannic Moog
To get the [] annotation working with python 3.7 and 3.8, import annotations.
Reported-by Tim Harvey <[email protected]>Fixes 21bc3433a43d ("binman: rework dropping absent entries from packaged image")Reviewed-by Bryan Brattlof <[email protected]>Signed-off-by Yannic Moog <[email protected]>---
Changes in v3:
- drop the deprecated and soon-to-be-removed typing package needed for
python 3.6 and 3.5 support. Instead use__future__which is supported
by python >= 3.7
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- drop newline changes
- Link to v1: https://lore.kernel.org/r/[email protected]--- tools/binman/etype/cbfs.py | 1 + tools/binman/etype/mkimage.py | 1 + tools/binman/etype/section.py | 1 + 3 files changed, 3 insertions(+)tools/binman/etype/cbfs.py +1
-0@@ -5,6 +5,7 @@ # Entry-type module for a Coreboot Filesystem (CBFS) # +from __future__ import annotations from collections import OrderedDict from binman import cbfs_utiltools/binman/etype/mkimage.py +1
-0@@ -5,6 +5,7 @@ # Entry-type module for producing an image using mkimage # +from __future__ import annotations from collections import OrderedDict from binman.entry import Entrytools/binman/etype/section.py +1
-1@@ -8,6 +8,7 @@ Sections are entries which can contain other entries. This allows hierarchical images to be created. """ +from __future__ import annotations from collections import OrderedDict import concurrent.futures import re ---base-commit:
6bb0679377abb01a82db1ce69b5bf1d40aa02ace
change-id: 20250710-binman-typing-fix-a207bed6416b
Quoted 4 lines
Best regards,
--
Yannic Moog <[email protected]>
Thanks Yannic,
This one works for me as well.
24.04.6 LTS)
Best Regards,
Tim
Quoted 5 lines · Yannic Moog
To get the [] annotation working with python 3.7 and 3.8, import annotations.
Tested-by:
Applied to u-boot/master, thanks!
[1/1] binman: Fix typing for python >= 3.7
commit: 187ac12927c042a982961096c9a418287b8e97e2
Signature · 1 line
Tom