From 5e630e7ebbfeffe42d72f5f607f51c84484bc17c Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Tue, 15 Jul 2025 23:26:34 -0400 Subject: [PATCH] Fix GitHub workflow to properly activate virtual environment - Combine venv setup and tito execution in same step - Add pytest installation for tito environment validation - Add explanatory comments about GitHub Actions shell behavior - Remove environment skipping hack in favor of proper setup - Workflow now uses tito CLI consistently for book generation --- .github/workflows/deploy-book.yml | 10 +++++++++- tito/main.py | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml index 2e15f9b0..663539fc 100644 --- a/.github/workflows/deploy-book.yml +++ b/.github/workflows/deploy-book.yml @@ -1,6 +1,7 @@ -name: Deploy TinyTorch Jupyter Book (Streamlined) +name: Deploy TinyTorch Jupyter Book (Streamlined with tito) # Trigger the workflow on push to main branch (publishing) or manual dispatch +# This workflow uses tito CLI for consistent book generation and building on: push: branches: [ main ] @@ -48,10 +49,17 @@ jobs: pip install --upgrade pip pip install jupyter-book jupytext pip install -r book/requirements.txt + pip install -r requirements.txt # Install main project dependencies pip install -e . # Install tito CLI - name: Generate content and build book run: | + # Set up virtual environment and run tito in same step + # Note: Each GitHub Actions step runs in a separate shell, + # so we need to activate the venv in the same step as tito + python -m venv .venv + source .venv/bin/activate + pip install pytest # Install missing dependency for tito environment checks # Use tito to generate content and build book tito book build diff --git a/tito/main.py b/tito/main.py index 4448c1b5..d353ed59 100644 --- a/tito/main.py +++ b/tito/main.py @@ -11,6 +11,7 @@ A professional command-line interface with proper architecture: import argparse import logging +import os import sys from pathlib import Path from typing import Dict, Type, Optional, List