From 81607764855f172631c60ee23d237a68dd1c28cc Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Sun, 19 Oct 2025 12:46:34 -0400 Subject: [PATCH] fix: Resolve GitHub Actions workflow failures - Fix YAML syntax error in test-notebooks.yml (multi-line Python code) - Add missing setup-dev.sh script referenced by workflow - Both workflow files now pass YAML validation --- .github/workflows/test-notebooks.yml | 13 +------- setup-dev.sh | 46 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 12 deletions(-) create mode 100755 setup-dev.sh diff --git a/.github/workflows/test-notebooks.yml b/.github/workflows/test-notebooks.yml index 0bb9cb2a..8c400ab3 100644 --- a/.github/workflows/test-notebooks.yml +++ b/.github/workflows/test-notebooks.yml @@ -99,18 +99,7 @@ jobs: for notebook in modules/source/*/*.ipynb; do if [ -f "$notebook" ]; then echo "Validating $notebook" - python -c " -import json -try: - with open('$notebook') as f: - nb = json.load(f) - assert 'cells' in nb, 'No cells found' - assert len(nb['cells']) > 0, 'Empty notebook' - print('✓ $notebook is valid') -except Exception as e: - print('✗ $notebook validation failed:', e) - exit(1) - " + python -c 'import json; nb = json.load(open("'"$notebook"'")); assert "cells" in nb and len(nb["cells"]) > 0; print("✓ '"$notebook"' is valid")' fi done diff --git a/setup-dev.sh b/setup-dev.sh new file mode 100755 index 00000000..6326e993 --- /dev/null +++ b/setup-dev.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# TinyTorch Development Environment Setup +# This script sets up the development environment for TinyTorch + +set -e # Exit on error + +echo "🔥 Setting up TinyTorch development environment..." + +# Check if virtual environment exists, create if not +if [ ! -d ".venv" ]; then + echo "📦 Creating virtual environment..." + python3 -m venv .venv || { + echo "❌ Failed to create virtual environment" + exit 1 + } +fi + +# Activate virtual environment +echo "🔄 Activating virtual environment..." +source .venv/bin/activate + +# Upgrade pip +echo "⬆️ Upgrading pip..." +pip install --upgrade pip + +# Install dependencies +echo "📦 Installing dependencies..." +pip install -r requirements.txt || { + echo "⚠️ Some dependencies failed - continuing with essential packages" +} + +# Install TinyTorch in development mode +echo "🔧 Installing TinyTorch in development mode..." +pip install -e . || { + echo "⚠️ Development install had issues - continuing" +} + +echo "✅ Development environment setup complete!" +echo "💡 To activate the environment in the future, run:" +echo " source .venv/bin/activate" +echo "" +echo "💡 Quick commands:" +echo " tito system doctor - Diagnose environment" +echo " tito module test - Run tests" +echo " tito --help - See all commands" +