From 55b7adba193d5b0a2204c449292264254f56142e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 26 Sep 2026 10:35:33 +0000 Subject: [PATCH] Add Cloud Agent development environment for Foxglove tutorials Set up a Python virtual environment with the dependencies needed to run the repo-wide README generator (enforced in CI) plus the runnable Foxglove SDK Python tutorials (ROSCON Spain 2024 CSV->MCAP and the EtherNet/IP integration). Co-authored-by: mat --- .cursor/environment.json | 4 ++++ .cursor/install.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .cursor/environment.json create mode 100755 .cursor/install.sh diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 0000000..41b1256 --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,4 @@ +{ + "name": "Foxglove Tutorials", + "install": "bash .cursor/install.sh" +} diff --git a/.cursor/install.sh b/.cursor/install.sh new file mode 100755 index 0000000..ff74a96 --- /dev/null +++ b/.cursor/install.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# Cloud Agent install script for the Foxglove tutorials repository. +# Idempotent: safe to run repeatedly. Creates an isolated Python virtual +# environment and installs the dependencies needed to run the repo-wide +# README generator plus the runnable Foxglove SDK Python tutorials. +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +VENV_DIR="${FOXGLOVE_TUTORIALS_VENV:-$HOME/.venvs/foxglove-tutorials}" + +# System package required to create Python 3 virtual environments on Ubuntu. +if ! python3 -c "import ensurepip" >/dev/null 2>&1; then + sudo apt-get update + sudo apt-get install -y "python3-venv" +fi + +# Create the virtual environment if it does not already exist. +if [ ! -x "$VENV_DIR/bin/python" ]; then + python3 -m venv "$VENV_DIR" +fi + +PY="$VENV_DIR/bin/python" +"$PY" -m pip install --upgrade pip + +# Consolidated dependency set: +# - .utils/requirements.txt: README generator (jinja2, pyyaml) enforced in CI +# - foxglove_sdk/ethernet_ip_integration/requirements.txt: foxglove-sdk, cpppo, pylogix, numpy +# - pandas + mcap: used by the ROSCON Spain 2024 CSV -> MCAP tutorial +PIP_ARGS=() +[ -f "$REPO_ROOT/.utils/requirements.txt" ] && PIP_ARGS+=(-r "$REPO_ROOT/.utils/requirements.txt") +[ -f "$REPO_ROOT/foxglove_sdk/ethernet_ip_integration/requirements.txt" ] && \ + PIP_ARGS+=(-r "$REPO_ROOT/foxglove_sdk/ethernet_ip_integration/requirements.txt") + +"$PY" -m pip install "${PIP_ARGS[@]}" pandas mcap + +echo "Foxglove tutorials environment ready. Activate with:" +echo " source \"$VENV_DIR/bin/activate\""