diff --git a/data/stack.json b/data/stack.json index 32aa3d7..bb9a04a 100644 --- a/data/stack.json +++ b/data/stack.json @@ -179,7 +179,7 @@ {"name": "castif", "group": "vision", "does": "Stream what your app draws to a screen across the room.", "repo": "micropython-pydevices", "path": "modules/castif", "get": ["firmware"], "runs": "MP on ESP32-P4"}, {"name": "vision", "group": "vision", "does": "Run image models and handle pictures with ESP-DL, plus H.264 and RTSP on the P4.", "repo": "micropython-pydevices", "path": "modules/vision", "get": ["optin"], "runs": "MP on ESP32-S3, P4"}, {"name": "tflite", "group": "vision", "does": "Run TensorFlow Lite Micro models on a board, from speech to person detection.", "repo": "micropython-pydevices", "path": "modules/tflite", "get": ["optin"], "runs": "MP on ESP32-S3, P4"}, - {"name": "ulab", "group": "vision", "does": "Work with numpy-like arrays.", "repo": "micropython-pydevices", "path": "modules.lock", "web": "https://github.com/v923z/micropython-ulab", "get": ["firmware"], "runs": "MP"}, + {"name": "ulab", "group": "vision", "does": "Work with numpy-like arrays.", "repo": "micropython-pydevices", "path": "docs/reference/modules.md", "web": "https://github.com/v923z/micropython-ulab", "get": ["firmware"], "runs": "MP"}, {"name": "Display drivers", "group": "drivers", "does": "Drive ILI9341, ST7789, SSD1306, GC9A01 and other panels.", "repo": "pydevices", "path": "drivers/display", "guide": "docs/boards/display-drivers.md", "get": ["chipmip"], "runs": "MP, CP"}, {"name": "Touch drivers", "group": "drivers", "does": "Read FT6x36, GT911, CST8xx, XPT2046 and other touch panels.", "repo": "pydevices", "path": "drivers/touch", "guide": "docs/boards/touch-drivers.md", "get": ["chipmip"], "runs": "MP, CP"}, diff --git a/scripts/cloud-workspace-install.sh b/scripts/cloud-workspace-install.sh index 87537cd..d6d7252 100755 --- a/scripts/cloud-workspace-install.sh +++ b/scripts/cloud-workspace-install.sh @@ -151,6 +151,14 @@ shallow_clone_if_missing() { return 0 fi log "clone $url @ $branch -> $dir" + if [[ "$branch" =~ ^[0-9a-f]{40}$ ]]; then + # A full commit: clone --branch takes only branches and tags. + git init -q "$path" + git -C "$path" remote add origin "$url" + git -C "$path" fetch -q --depth 1 --filter=blob:none origin "$branch" + git -C "$path" -c advice.detachedHead=false checkout -q FETCH_HEAD + return 0 + fi git clone --depth 1 --filter=blob:none --branch "$branch" --single-branch \ "$url" "$path" } @@ -196,17 +204,28 @@ link_pydevices android-template "$REPOS/android-template" # The C modules (displayif, audioif, cameraif, usbhost) live inside # micropython-pydevices under modules/, so they need no checkout of their own; # build_mp.py clones anything else it needs (ulab, say) at the commit -# modules.lock pins. The repositories below are siblings at the workspace root, +# micropython-pydevices pins. The repositories below are siblings at the workspace root, # the layout every build script in the org defaults to. for s in micropython-pydevices audiodsp pygraphics \ omnipython-lvgl; do [[ -d "$REPOS/$s" || -L "$REPOS/$s" ]] && link_pydevices "$s" "$REPOS/$s" done -# The interpreter checkouts, beside the repositories. The MicroPython tag is -# the one micropython-pydevices pins, and patches/apply_patches.py there +# The interpreter checkouts, beside the repositories. The MicroPython commit is +# the one micropython-pydevices pins (in DEPENDENCIES.lock, or UPSTREAM in a +# checkout from before that file), and patches/apply_patches.py there # applies the patch series once (build_mp.py would also do it on first use). -MP_TAG="${PYDEVICES_MP_TAG:-$(tr -d '[:space:]' < "$REPOS/micropython-pydevices/UPSTREAM" 2>/dev/null || echo v1.29.0)}" +mp_pin() { + local mpp="$REPOS/micropython-pydevices" + if [[ -f "$mpp/DEPENDENCIES.lock" ]]; then + awk '$1 == "micropython" { print $3 }' "$mpp/DEPENDENCIES.lock" + elif [[ -f "$mpp/UPSTREAM" ]]; then + tr -d '[:space:]' < "$mpp/UPSTREAM" + else + echo v1.29.0 + fi +} +MP_TAG="${PYDEVICES_MP_TAG:-$(mp_pin)}" CP_TAG="${PYDEVICES_CP_TAG:-10.3.0}" shallow_clone_if_missing micropython https://github.com/micropython/micropython.git "$MP_TAG" shallow_clone_if_missing circuitpython https://github.com/adafruit/circuitpython.git "$CP_TAG"