gromero commented on a change in pull request #9584:
URL: https://github.com/apache/tvm/pull/9584#discussion_r758743356
##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -71,14 +71,15 @@ class BoardAutodetectFailed(Exception):
PROJECT_OPTIONS = [
server.ProjectOption(
"arduino_board",
- required=["build", "flash", "open_transport"],
+ required=["generate_project", "build", "flash", "open_transport"],
choices=list(BOARD_PROPERTIES),
type="str",
help="Name of the Arduino board to build for.",
),
server.ProjectOption(
"arduino_cli_cmd",
- required=["build", "flash", "open_transport"],
+ optional=["build", "flash", "open_transport"],
Review comment:
> shouldn't that be optional since it has default value?
@mehrdadh That's right. That part in my suggestion should cover that case:
```
+
+ARDUINO_CLI_CMD = shutil.which("arduino-cli")
+
+
PROJECT_OPTIONS = [
server.ProjectOption(
"arduino_board",
@@ -78,7 +82,9 @@ PROJECT_OPTIONS = [
),
server.ProjectOption(
"arduino_cli_cmd",
- required=["build", "flash", "open_transport"],
+ required=["generate_project", "build", "flash", "open_transport"]
if not ARDUINO_CLI_CMD else None,
+ optional=["generate_project", "build", "flash", "open_transport"]
if ARDUINO_CLI_CMD else None,
+ default=ARDUINO_CLI_CMD,
type="str",
```
I.e. if the `arduino-cli` is found `optional` is set accordingly, but if not
that option is set as `required` for all methods.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]