summaryrefslogtreecommitdiff
path: root/tools/manifestfile.py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-09-19 12:05:39 +1000
committerDamien George <damien@micropython.org>2022-09-19 23:51:10 +1000
commit920da9c5e30da58d5f77b2c5e28c74e3670e6a3b (patch)
tree6a60c130a453e957d737a652c8d0c974b2fe69c9 /tools/manifestfile.py
parent6ecdf1a240e43bd60c824c7efd575c0a82d02d7e (diff)
unix/variants/coverage: Add test for manifest freeze_mpy().
This uses the frozentest.mpy that is also used by ports/minimal. Also fixes two bugs that these new tests picked up: - File extension matching in manifestfile.py. - Handling of freeze_mpy results in makemanifest. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tools/manifestfile.py')
-rw-r--r--tools/manifestfile.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/manifestfile.py b/tools/manifestfile.py
index 84c79ed82..a4d056137 100644
--- a/tools/manifestfile.py
+++ b/tools/manifestfile.py
@@ -394,28 +394,37 @@ class ManifestFile:
`opt` is the optimisation level to pass to mpy-cross when compiling .py
to .mpy.
"""
- self._freeze_internal(path, script, exts=(".py", ".mpy"), kind=KIND_FREEZE_AUTO, opt=opt)
+ self._freeze_internal(
+ path,
+ script,
+ exts=(
+ ".py",
+ ".mpy",
+ ),
+ kind=KIND_FREEZE_AUTO,
+ opt=opt,
+ )
def freeze_as_str(self, path):
"""
Freeze the given `path` and all .py scripts within it as a string,
which will be compiled upon import.
"""
- self._search(path, None, None, exts=(".py"), kind=KIND_FREEZE_AS_STR)
+ self._search(path, None, None, exts=(".py",), kind=KIND_FREEZE_AS_STR)
def freeze_as_mpy(self, path, script=None, opt=None):
"""
Freeze the input (see above) by first compiling the .py scripts to
.mpy files, then freezing the resulting .mpy files.
"""
- self._freeze_internal(path, script, exts=(".py"), kind=KIND_FREEZE_AS_MPY, opt=opt)
+ self._freeze_internal(path, script, exts=(".py",), kind=KIND_FREEZE_AS_MPY, opt=opt)
def freeze_mpy(self, path, script=None, opt=None):
"""
Freeze the input (see above), which must be .mpy files that are
frozen directly.
"""
- self._freeze_internal(path, script, exts=(".mpy"), kind=KIND_FREEZE_MPY, opt=opt)
+ self._freeze_internal(path, script, exts=(".mpy",), kind=KIND_FREEZE_MPY, opt=opt)
# Generate a temporary file with a line appended to the end that adds __version__.