velxio/test/backend/unit
David Montero Crespo d7a4b5e4eb feat(micropython): install libraries from the micropython-lib index (#214)
A MicroPython library in Velxio IS a .py file in the project, copied onto
the board's filesystem before main.py runs. That mechanism worked, but
getting the file meant hunting GitHub by hand — the gap issue #214 is
about. Now the Library Manager fills it, in both halves:

Backend: /api/micropython-libs proxies the official micropython-lib
package index (the same one `mip` uses on real hardware). /search filters
the index; /fetch resolves a package plus its declared deps into .py
files. The proxy is what makes this safe to expose: only the official
index is reachable (the name must exist in index.json, files come from its
content-addressed store), source only (.py, never .mpy bytecode), path-
safe, and capped at 24 files / 256 KB per install. In-process TTL cache
over the index.

Frontend: the same Library Manager modal, mode-aware. On a MicroPython
board the search hits the index and "Add to project" writes the package's
files into the board's workspace (upsert — re-adding is the upgrade path),
visible in the explorer and travelling with the project. Before typing it
shows featured picks (ssd1306, umqtt.*, urequests) and the modules already
frozen into the firmware (neopixel, dht, onewire, ds18x20, machine,
network) labeled "built into the firmware", so searching for one answers
"just import it" instead of an empty list.

The file-materialization prelude now creates package directories: umqtt
ships as umqtt/simple.py, and MicroPython's open() does not mkdir, so the
prelude died with ENOENT on any packaged module.

Also ships a gallery example ("ESP32 + MicroPython: use an external
library") that documents the file-is-the-library mechanism with the
ssd1306 driver on the wired OLED.
2026-08-18 21:50:10 +02:00
..
__init__.py
…
test_arduino_cli_attinycore.py
…
test_arduino_cli_error_messages.py fix(arduino-cli): library search/install failures become one actionable sentence 2026-08-18 00:28:07 +02:00
test_boot_images.py
…
test_compile_build_lock.py fix(compile): lock the build DIRECTORY, not the FQBN — concurrent compiles swapped binaries 2026-08-17 09:12:26 +02:00
test_compile_dedup.py
…
test_dht22_worker.py test(dht22): skip absolute-timing busy_wait checks under CI 2026-05-17 22:31:37 +02:00
test_esp32_wifi_args.py chore(tests): silence three noisy warnings in deploy-gate output 2026-05-16 22:39:43 +02:00
test_esp32_wifi_webserver.py
…
test_esp32c3_wifi_args.py
…
test_espidf_compiler.py fix(espidf): a header-only library broke every ESP32 build 2026-08-03 07:26:01 +02:00
test_espidf_core_first.py espidf: never resolve generic platform headers against user libraries 2026-08-04 05:23:42 +02:00
test_espidf_include_scanner.py fix(espidf): unknown #if must not prune its #else in the include scanner 2026-08-15 04:14:00 +02:00
test_espidf_library_ranking.py feat(libraries): manifest auto-migration + name-affinity ranking + install-declares 2026-08-04 06:03:32 +02:00
test_espidf_pure_mode.py merge: master (produccion) dentro de v3.2 2026-07-25 21:52:00 +02:00
test_espidf_real_paths.py
…
test_i2c_slaves.py
…
test_mcp_tools.py
…
test_micropython_libs.py feat(micropython): install libraries from the micropython-lib index (#214) 2026-08-18 21:50:10 +02:00
test_signal_router.py fix(esp32): LEDC signal IDs are 71-86 per ESP32 TRM, not 72-87 2026-05-17 05:42:52 +02:00
test_wifi_status_parser.py
…