Fix docs generation build issues

This commit is contained in:
Mark Backman
2024-12-12 16:11:48 -05:00
parent 7bbc0ee8df
commit 19c178ebc7
8 changed files with 34 additions and 62 deletions

View File

@@ -4,58 +4,26 @@ build:
os: ubuntu-22.04 os: ubuntu-22.04
tools: tools:
python: '3.12' python: '3.12'
apt_packages:
- portaudio19-dev
- python3-dev
- libasound2-dev
jobs: jobs:
pre_build: pre_build:
# Commands to run before the build
- python -m pip install --upgrade pip - python -m pip install --upgrade pip
- pip install wheel setuptools - pip install wheel setuptools
post_build: post_build:
# Commands to run after the build
- echo "Build completed" - echo "Build completed"
sphinx: sphinx:
configuration: docs/api/conf.py configuration: docs/api/conf.py
fail_on_warning: false # Set to true if you want builds to fail on warnings fail_on_warning: false
python: python:
install: install:
- requirements: docs/api/requirements-base.txt - requirements: docs/api/requirements.txt
# Try to install Riva first, fall back to PlayHT if it fails
- requirements: docs/api/requirements-riva.txt || true
- requirements: docs/api/requirements-playht.txt || true
- method: pip - method: pip
path: . path: .
extra_requirements:
- anthropic
- assemblyai
- aws
- azure
- canonical
- cartesia
- daily
- deepgram
- elevenlabs
- fal
- fireworks
- gladia
- google
- grok
- groq
- krisp
- langchain
- livekit
- lmnt
- local
- moondream
- nim
- noisereduce
- openai
- openpipe
- silero
- simli
- soundfile
- websocket
- whisper
search: search:
ranking: ranking:

View File

@@ -7,7 +7,7 @@ This directory contains the source files for auto-generating Pipecat's server AP
1. Install documentation dependencies: 1. Install documentation dependencies:
```bash ```bash
pip install -r requirements-base.txt requirements-playht.txt requirements-riva.txt pip install -r requirements.txt
``` ```
2. Make the build scripts executable: 2. Make the build scripts executable:

View File

@@ -44,7 +44,12 @@ autodoc_default_options = {
autodoc_mock_imports = [ autodoc_mock_imports = [
"riva", "riva",
"livekit", "livekit",
"pyht", "pyht", # Base PlayHT package
"pyht.async_client", # PlayHT specific imports
"pyht.client",
"pyht.protos",
"pyht.protos.api_pb2",
"pipecat_ai_playht", # PlayHT wrapper
"anthropic", "anthropic",
"assemblyai", "assemblyai",
"boto3", "boto3",
@@ -63,13 +68,14 @@ autodoc_mock_imports = [
"openpipe", "openpipe",
"simli", "simli",
"soundfile", "soundfile",
# Add these new mocks # Existing mocks
"pipecat_ai_krisp",
"pyaudio", "pyaudio",
"_tkinter", "_tkinter",
"tkinter", "tkinter",
"daily", "daily",
"daily_python", "daily_python",
"pydantic.BaseModel", # Mock base pydantic to avoid model conflicts "pydantic.BaseModel",
"pydantic.Field", "pydantic.Field",
"pydantic._internal._model_construction", "pydantic._internal._model_construction",
"pydantic._internal._fields", "pydantic._internal._fields",

View File

@@ -1,3 +0,0 @@
# Force specific grpcio version for PlayHT
grpcio>=1.68.0
pipecat-ai[playht]

View File

@@ -1,3 +0,0 @@
# Force specific grpcio version for Riva
grpcio==1.65.4
pipecat-ai[riva]

View File

@@ -21,7 +21,7 @@ pipecat-ai[gladia]
pipecat-ai[google] pipecat-ai[google]
pipecat-ai[grok] pipecat-ai[grok]
pipecat-ai[groq] pipecat-ai[groq]
pipecat-ai[krisp] # pipecat-ai[krisp] # Mocked instead
pipecat-ai[langchain] pipecat-ai[langchain]
pipecat-ai[livekit] pipecat-ai[livekit]
pipecat-ai[lmnt] pipecat-ai[lmnt]
@@ -30,7 +30,9 @@ pipecat-ai[moondream]
pipecat-ai[nim] pipecat-ai[nim]
pipecat-ai[noisereduce] pipecat-ai[noisereduce]
pipecat-ai[openai] pipecat-ai[openai]
pipecat-ai[openpipe] # pipecat-ai[openpipe]
# pipecat-ai[playht] # Mocked due to grpcio conflict with riva
pipecat-ai[riva]
pipecat-ai[silero] pipecat-ai[silero]
pipecat-ai[simli] pipecat-ai[simli]
pipecat-ai[soundfile] pipecat-ai[soundfile]

View File

@@ -10,20 +10,15 @@ echo "Creating test directory: $TEST_DIR"
mkdir -p "$TEST_DIR" mkdir -p "$TEST_DIR"
cd "$TEST_DIR" cd "$TEST_DIR"
# Create single virtual environment # Create virtual environment
python -m venv venv python -m venv venv
source venv/bin/activate source venv/bin/activate
echo "Installing base dependencies..." echo "Installing build dependencies..."
pip install --upgrade pip wheel setuptools pip install --upgrade pip wheel setuptools
pip install -r "$DOCS_DIR/requirements-base.txt"
# Try to install optional dependencies, but don't fail if they don't work echo "Installing documentation dependencies..."
echo "Installing Riva dependencies..." pip install -r "$DOCS_DIR/requirements.txt"
pip install -r "$DOCS_DIR/requirements-riva.txt" || echo "Failed to install Riva dependencies"
echo "Installing PlayHT dependencies..."
pip install -r "$DOCS_DIR/requirements-playht.txt" || echo "Failed to install PlayHT dependencies"
echo "Building documentation..." echo "Building documentation..."
cd "$DOCS_DIR" cd "$DOCS_DIR"
@@ -31,6 +26,13 @@ sphinx-build -b html . "_build/html"
echo "Build complete. Check _build/html directory for output." echo "Build complete. Check _build/html directory for output."
# Print summary
echo -e "\n=== Build Summary ==="
echo "Documentation: $DOCS_DIR/_build/html"
echo "Test environment: $TEST_DIR"
echo -e "\nTo view the documentation:"
echo "open $DOCS_DIR/_build/html/index.html"
# Print installed packages for verification # Print installed packages for verification
echo "Installed packages:" echo -e "\n=== Installed Packages ==="
pip freeze pip freeze | grep -E "sphinx|pipecat"

View File

@@ -8,7 +8,7 @@ import asyncio
from typing import AsyncGenerator, Optional from typing import AsyncGenerator, Optional
from loguru import logger from loguru import logger
from pydantic.main import BaseModel from pydantic import BaseModel
from pipecat.frames.frames import ( from pipecat.frames.frames import (
CancelFrame, CancelFrame,