Commit Graph

6 Commits

Author SHA1 Message Date
Angus Gratton cec3ff5526 mpy-cross: Fix source file name in file-not-found error.
Found by Ruff with F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16 16:13:01 +10:00
Jim Mussared e4d90be680 mpy-cross/mpy_cross: Add docstrings to public methods. 2022-09-28 11:47:11 +10:00
Jim Mussared 370a87dd12 mpy-cross/mpy_cross: Add list of architectures to `__all__`.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-28 11:47:11 +10:00
Jim Mussared ee1b4a2026 mpy-cross/mpy_cross: Add a way to query the mpy version.
This returns the mpy version and sub-version for files compiled with this
mpy-cross binary.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-28 11:47:11 +10:00
Jim Mussared 71050870b8 mpy-cross/mpy_cross: Fix default path to mpy-cross binary.
Needed to be updated to use build/mpy-cross.

Also fixes some other issues in the Python wrapper:
 - Rename find_mpy_cross_binary to _find_mpy_cross_binary
 - Fix passing of -march arg.
 - Decode stdout from subprocess.
 - Print stdout from mpy-cross in __main__.py.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-28 11:37:22 +10:00
Jim Mussared e42809531f mpy-cross/mpy_cross: Add Python wrapper for mpy-cross.
Rather than invoking mpy-cross directly via system/subprocess in our build
tools and other tools, this provides a Python interface for it.

Based on https://gitlab.com/alelec/mpy_cross (with the intention of
eventually replacing that as the "official" pypi distribution once setup.py
etc are added).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-05 17:06:09 +10:00