Skip to content

Commit 6868a06

Browse files
committed
micropython/bundle-typing: Add bundle for typing modules.
This also defaults the mpy-cross opt level to 3, to reduce firmware size. Signed-off-by: Jos Verlinde <[email protected]>
1 parent 3e07ccf commit 6868a06

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# type: ignore[all]
2+
3+
metadata(
4+
version="1.26.1",
5+
description="Limited runtime typing support for MicroPython.",
6+
)
7+
8+
options.defaults(opt_level=3, extensions=False)
9+
10+
# Primary typing related modules
11+
require("__future__", opt_level=options.opt_level)
12+
require("typing", opt_level=options.opt_level)
13+
require("abc", opt_level=options.opt_level)
14+
15+
# # Optional typing modules
16+
if options.extensions:
17+
require("typing_extensions", opt_level=options.opt_level)
18+
require("collections-abc", opt_level=options.opt_level)

0 commit comments

Comments
 (0)