mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-17 19:00:58 +00:00
build(core): exclude all "from typing" imports from build
This commit is contained in:
parent
3100961dda
commit
bda1fa9912
@ -28,8 +28,11 @@ def generate(env):
|
|||||||
btc_only = env['bitcoin_only'] == '1'
|
btc_only = env['bitcoin_only'] == '1'
|
||||||
interim = f"{target[:-4]}.i" # replace .mpy with .i
|
interim = f"{target[:-4]}.i" # replace .mpy with .i
|
||||||
sed_scripts = " ".join([
|
sed_scripts = " ".join([
|
||||||
f"-e 's/utils\.BITCOIN_ONLY/{btc_only}/g'",
|
rf"-e 's/utils\.BITCOIN_ONLY/{btc_only}/g'",
|
||||||
"-e 's/if TYPE_CHECKING/if False/'",
|
r"-e 's/if TYPE_CHECKING/if False/'",
|
||||||
|
r"-e 's/import typing/# \0/'",
|
||||||
|
r"-e '/from typing import (/,/^\s*)/ {s/^/# /}'",
|
||||||
|
r"-e 's/from typing import/# \0/'"
|
||||||
])
|
])
|
||||||
return f'$SED {sed_scripts} {source} > {interim} && $MPY_CROSS -o {target} -s {source_name} {interim}'
|
return f'$SED {sed_scripts} {source} > {interim} && $MPY_CROSS -o {target} -s {source_name} {interim}'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user