Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Python interface in addition to command line interface: Return the firmware file #18

Open
hmaerki opened this issue Aug 29, 2024 · 3 comments

Comments

@hmaerki
Copy link

hmaerki commented Aug 29, 2024

mpbuild could be used in octoprobe.

The python interface just behind the command line interface is:

    # Find the port for the supplied board
    port = get_port(board)

    build_board(port, board, variant, extra_args or [], build_container, idf)

This is find as it is easy to use.

However it would be helpful when build_board would return the path to the firmware which just was built.

@hmaerki hmaerki changed the title Python interface in addition to command line interface: Path to the firmware file. Enhancment: Python interface in addition to command line interface: Return the firmware file. Aug 29, 2024
Repository owner deleted a comment from wahyu-n Aug 29, 2024
@hmaerki hmaerki changed the title Enhancment: Python interface in addition to command line interface: Return the firmware file. Enhancement: Python interface in addition to command line interface: Return the firmware file Aug 29, 2024
@Josverl
Copy link
Contributor

Josverl commented Aug 30, 2024

I'd been considering a similar request for mpbuild to be called from mpflash

@hmaerki
Copy link
Author

hmaerki commented Aug 30, 2024

I now started using the code in src/mpbuild/find_boards.py.

The interface is not self-explanatory. There are python dicts and no code completion on these dicts.

So my proposal would be to just rewrite this file using dataclasses.

If you are interested, I could make a proposal in form of a PR.

@mattytrentini
Copy link
Owner

It makes sense for mpbuild to be a callable module as well as cli tool; that was my intention though I've mostly been trying to get the cli side done.

@hmaerki please feel free to raise a PR but this is very early days in mpbuild's life, I've shown it as early as I could, I still intend to overhaul it quite a lot. Updating board_db is on my radar - but I would definitely like to keep it lightweight and simple. I'm not unhappy with the data structure, but it could use a light touch to improve usability - a dataclass is a good idea. You may want to wait a few days though as I have some changes to integrate that will make rebasing a little difficult...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants