mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2025-12-05 19:17:52 -06:00
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
This commit is contained in:
13
.github/workflows/test-notebooks.yml
vendored
13
.github/workflows/test-notebooks.yml
vendored
@@ -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
|
||||
|
||||
|
||||
46
setup-dev.sh
Executable file
46
setup-dev.sh
Executable file
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user