mirror of
https://github.com/micropython/micropython.git
synced 2025-09-10 11:50:40 +02:00
Some checks are pending
JavaScript code lint and formatting with Biome / eslint (push) Waiting to run
Check code formatting / code-formatting (push) Waiting to run
Check spelling with codespell / codespell (push) Waiting to run
Build docs / build (push) Waiting to run
Check examples / embedding (push) Waiting to run
Package mpremote / build (push) Waiting to run
.mpy file format and tools / test (push) Waiting to run
Build ports metadata / build (push) Waiting to run
cc3200 port / build (push) Waiting to run
esp32 port / build_idf (esp32_build_cmod_spiram_s2) (push) Waiting to run
esp32 port / build_idf (esp32_build_s3_c3) (push) Waiting to run
esp8266 port / build (push) Waiting to run
mimxrt port / build (push) Waiting to run
nrf port / build (push) Waiting to run
powerpc port / build (push) Waiting to run
qemu port / build_and_test_arm (push) Waiting to run
qemu port / build_and_test_rv32 (push) Waiting to run
renesas-ra port / build_renesas_ra_board (push) Waiting to run
rp2 port / build (push) Waiting to run
samd port / build (push) Waiting to run
stm32 port / build_stm32 (stm32_misc_build) (push) Waiting to run
stm32 port / build_stm32 (stm32_nucleo_build) (push) Waiting to run
stm32 port / build_stm32 (stm32_pyb_build) (push) Waiting to run
unix port / minimal (push) Waiting to run
unix port / reproducible (push) Waiting to run
unix port / standard (push) Waiting to run
unix port / standard_v2 (push) Waiting to run
unix port / coverage (push) Waiting to run
unix port / coverage_32bit (push) Waiting to run
unix port / nanbox (push) Waiting to run
unix port / float (push) Waiting to run
unix port / stackless_clang (push) Waiting to run
unix port / float_clang (push) Waiting to run
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
All board IDs are now the board directory name. Signed-off-by: Damien George <damien@micropython.org>
104 lines
2.9 KiB
Python
Executable File
104 lines
2.9 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import glob
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
VALID_FEATURES = {
|
|
# Connectivity
|
|
"BLE",
|
|
"CAN",
|
|
"Ethernet",
|
|
"LoRa",
|
|
"USB",
|
|
"USB-C",
|
|
"WiFi",
|
|
# MCU features
|
|
"Dual-core",
|
|
"External Flash",
|
|
"External RAM",
|
|
# Form factor
|
|
"Feather",
|
|
# Connectors / sockets
|
|
"JST-PH",
|
|
"JST-SH",
|
|
"mikroBUS",
|
|
"microSD",
|
|
"SDCard",
|
|
# Sensors
|
|
"Environment Sensor",
|
|
"IMU",
|
|
# Other
|
|
"Audio Codec",
|
|
"Battery Charging",
|
|
"Camera",
|
|
"DAC",
|
|
"Display",
|
|
"Microphone",
|
|
"PoE",
|
|
"RGB LED",
|
|
"Secure Element",
|
|
}
|
|
|
|
|
|
def main(repo_path, output_path):
|
|
boards_index = []
|
|
board_ids = set()
|
|
|
|
for board_json in glob.glob(os.path.join(repo_path, "ports/*/boards/*/board.json")):
|
|
# Relative path to the board directory (e.g. "ports/stm32/boards/PYBV11").
|
|
board_dir = os.path.dirname(board_json)
|
|
# Relative path to the port (e.g. "ports/stm32")
|
|
port_dir = os.path.dirname(os.path.dirname(board_dir))
|
|
|
|
with open(board_json, "r") as f:
|
|
blob = json.load(f)
|
|
|
|
features = set(blob.get("features", []))
|
|
if not features.issubset(VALID_FEATURES):
|
|
print(
|
|
board_json,
|
|
"unknown features:",
|
|
features.difference(VALID_FEATURES),
|
|
file=sys.stderr,
|
|
)
|
|
sys.exit(1)
|
|
|
|
# The ID of a board is the board directory (e.g. "PYBV11").
|
|
blob["id"] = os.path.basename(board_dir)
|
|
|
|
# Check for duplicate board IDs.
|
|
if blob["id"] in board_ids:
|
|
print("Duplicate board ID: '{}'".format(blob["id"]), file=sys.stderr)
|
|
board_ids.add(blob["id"])
|
|
|
|
# Add in default fields.
|
|
blob["port"] = os.path.basename(port_dir)
|
|
blob["build"] = os.path.basename(board_dir)
|
|
boards_index.append(blob)
|
|
|
|
# Create the board markdown, which is the concatenation of the
|
|
# default "board.md" file (if exists), as well as any flashing
|
|
# instructions.
|
|
board_markdown = os.path.join(board_dir, "board.md")
|
|
with open(os.path.join(output_path, blob["id"] + ".md"), "w") as f:
|
|
if os.path.exists(board_markdown):
|
|
with open(board_markdown, "r") as fin:
|
|
f.write(fin.read())
|
|
|
|
if blob["deploy"]:
|
|
f.write("\n\n## Installation instructions\n")
|
|
for deploy in blob["deploy"]:
|
|
with open(os.path.join(board_dir, deploy), "r") as fin:
|
|
f.write(fin.read())
|
|
|
|
# Write the full index for the website to load.
|
|
with open(os.path.join(output_path, "index.json"), "w") as f:
|
|
json.dump(boards_index, f, indent=4, sort_keys=True)
|
|
f.write("\n")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main(sys.argv[1], sys.argv[2])
|