From c498a628eca4d34509c3456e84be426d8bd5ff57 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 7 May 2026 12:14:53 +0530 Subject: [PATCH] fix: fix CD to rely on pipecat dev dependey --- .github/workflows/docs-openapi-drift.yml | 26 +++++--- api/requirements.dev.txt | 10 +-- .../telephony/providers/telnyx/provider.py | 2 +- docs/contribution/setup.mdx | 36 ++++++----- scripts/setup_pipecat.ps1 | 25 -------- scripts/setup_pipecat.sh | 26 -------- scripts/setup_requirements.ps1 | 48 ++++++++++++++ scripts/setup_requirements.sh | 62 +++++++++++++++++++ 8 files changed, 149 insertions(+), 86 deletions(-) delete mode 100644 scripts/setup_pipecat.ps1 delete mode 100755 scripts/setup_pipecat.sh create mode 100644 scripts/setup_requirements.ps1 create mode 100755 scripts/setup_requirements.sh diff --git a/.github/workflows/docs-openapi-drift.yml b/.github/workflows/docs-openapi-drift.yml index bd2a5ef..b3024f1 100644 --- a/.github/workflows/docs-openapi-drift.yml +++ b/.github/workflows/docs-openapi-drift.yml @@ -4,11 +4,11 @@ on: pull_request: branches: [main] paths: - - 'api/**' - - 'pipecat/**' - - 'scripts/dump_docs_openapi.py' - - 'docs/api-reference/openapi.json' - - '.github/workflows/docs-openapi-drift.yml' + - "api/**" + - "pipecat/**" + - "scripts/dump_docs_openapi.py" + - "docs/api-reference/openapi.json" + - ".github/workflows/docs-openapi-drift.yml" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -27,16 +27,22 @@ jobs: - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: '3.12' + python-version: "3.12" cache: pip cache-dependency-path: | api/requirements.txt + api/requirements.dev.txt pipecat/pyproject.toml - - name: Install api dependencies - run: | - pip install -r api/requirements.txt - pip install './pipecat[cartesia,deepgram,openai,elevenlabs,groq,google,azure,sarvam,soundfile,silero,webrtc,speechmatics,openrouter,camb]' + - name: Set up Node 22 + uses: actions/setup-node@v4 + with: + node-version: "22" + cache: npm + cache-dependency-path: ui/package-lock.json + + - name: Install api and pipecat dependencies + run: ./scripts/setup_requirements.sh --dev - name: Dump OpenAPI spec env: diff --git a/api/requirements.dev.txt b/api/requirements.dev.txt index cebdad0..b5bd106 100644 --- a/api/requirements.dev.txt +++ b/api/requirements.dev.txt @@ -1,11 +1,5 @@ -mypy==1.15.0 -ruff==0.11.3 -pytest==8.3.5 -pytest-asyncio==0.26.0 -pre-commit==4.2.0 -watchfiles==1.1.0 -python-dotenv==1.2.1 +mypy==2.0.0 +watchfiles==1.1.1 datamodel-code-generator==0.56.1 twine==6.2.0 -build==1.2.2 -e ./sdk/python diff --git a/api/services/telephony/providers/telnyx/provider.py b/api/services/telephony/providers/telnyx/provider.py index e466bc5..9c92ef0 100644 --- a/api/services/telephony/providers/telnyx/provider.py +++ b/api/services/telephony/providers/telnyx/provider.py @@ -9,7 +9,7 @@ import random from typing import TYPE_CHECKING, Any, Dict, List, Optional import aiohttp -from fastapi import HTTPException +from fastapi import HTTPException, WebSocketDisconnect from loguru import logger from api.enums import WorkflowRunMode diff --git a/docs/contribution/setup.mdx b/docs/contribution/setup.mdx index 7054883..6dc95d0 100644 --- a/docs/contribution/setup.mdx +++ b/docs/contribution/setup.mdx @@ -18,9 +18,9 @@ All commands below are shown for **macOS / Linux**. Expand the **Windows** tab f ### Steps 1. Fork the Dograh repository by going to https://github.com/dograh-hq/dograh -2. Clone the forked repository on your machine +2. Clone the forked repository on your machine (use `--recurse-submodules` so the pipecat submodule is pulled in too) ``` -git clone https://github.com//dograh +git clone --recurse-submodules https://github.com//dograh cd dograh ``` 3. Create a python virtual environment @@ -34,19 +34,15 @@ python -m venv venv .\venv\Scripts\Activate.ps1 ``` -4. Install the requirements -``` -pip install -r api/requirements.txt -``` -5. Ensure you are on right version of Node.js using `node --version` +4. Ensure you are on right version of Node.js using `node --version` ``` nvm use 24 ``` -6. Install UI dependencies +5. Install UI dependencies ``` cd ui && npm install && cd .. ``` -7. Start local docker services +6. Start local docker services Please ensure you dont have any other instance of conflicting services running by checking `docker ps` ``` docker compose -f docker-compose-local.yaml up -d @@ -59,7 +55,7 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS 6c7cb8afdf18 redis:7 "docker-entrypoint.s…" 18 seconds ago Up 18 seconds (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp dograh-redis-1 a57e3e92b02c minio/minio "/usr/bin/docker-ent…" 18 seconds ago Up 18 seconds (healthy) 127.0.0.1:9000-9001->9000-9001/tcp dograh-minio-1 ``` -8. Setup environment variables +7. Setup environment variables ```bash macOS/Linux cp api/.env.example api/.env && cp ui/.env.example ui/.env @@ -69,16 +65,24 @@ Copy-Item api/.env.example api/.env Copy-Item ui/.env.example ui/.env ``` -9. Setup pipecat git submodule +8. Install Python requirements. The script initializes the pipecat submodule, installs `api/requirements.txt`, and installs pipecat with the required extras. Add the dev flag if you also want the pipecat dev dependency group (pytest, ruff, pre-commit, etc.). ```bash macOS/Linux -bash scripts/setup_pipecat.sh +# Default (runtime only) +bash scripts/setup_requirements.sh + +# Include pipecat dev dependencies +bash scripts/setup_requirements.sh --dev ``` ```powershell Windows -.\scripts\setup_pipecat.ps1 +# Default (runtime only) +.\scripts\setup_requirements.ps1 + +# Include pipecat dev dependencies +.\scripts\setup_requirements.ps1 -Dev ``` -10. Start backend services +9. Start backend services ```bash macOS/Linux bash scripts/start_services_dev.sh @@ -105,11 +109,11 @@ tail -f logs/latest/*.log Get-Content logs/latest/*.log -Wait ``` -11. Start the UI +10. Start the UI ``` cd ui && npm run dev ``` -12. You should be able to open the application on `localhost:3000` now +11. You should be able to open the application on `localhost:3000` now ### Next Steps We ship with AGENTS.md and CLAUDE.md which will help the Coding Agents get started quickly with the codebase. This should help your favourite coding agents to be able to navigate the codebase quickly and you can make changes to it and suit your specification better. diff --git a/scripts/setup_pipecat.ps1 b/scripts/setup_pipecat.ps1 deleted file mode 100644 index f831319..0000000 --- a/scripts/setup_pipecat.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env pwsh -# Setup script for using pipecat as a git submodule (Windows) - -$ErrorActionPreference = 'Stop' - -$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path -$BaseDir = Split-Path -Parent $ScriptDir -Set-Location $BaseDir - -Write-Host "Setting up pipecat as a git submodule..." - -# Initialize and update submodules -Write-Host "Initializing git submodules..." -git submodule update --init --recursive - -# Install dograh API requirements first so pipecat's extras win on any -# shared transitive dependencies (matches api/Dockerfile and CI workflow). -Write-Host "Installing dograh API requirements..." -pip install -r api/requirements.txt - -# Install pipecat in editable mode with all extras -Write-Host "Installing pipecat dependencies..." -pip install -e './pipecat[cartesia,deepgram,openai,elevenlabs,groq,google,azure,sarvam,soundfile,silero,webrtc,speechmatics,openrouter,camb]' - -Write-Host "Setup complete! Pipecat is now available as a git submodule." diff --git a/scripts/setup_pipecat.sh b/scripts/setup_pipecat.sh deleted file mode 100755 index cf4cc27..0000000 --- a/scripts/setup_pipecat.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Setup script for using pipecat as a git submodule - -# Get the project root directory (parent of scripts) -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -DOGRAH_DIR="$(dirname "$SCRIPT_DIR")" - -cd "$DOGRAH_DIR" - -echo "Setting up pipecat as a git submodule..." - -# Initialize and update submodules -echo "Initializing git submodules..." -git submodule update --init --recursive - -# Install dograh API requirements first so pipecat's extras win on any -# shared transitive dependencies (matches api/Dockerfile and CI workflow). -echo "Installing dograh API requirements..." -pip install -r api/requirements.txt - -# Install pipecat in editable mode with all extras -echo "Installing pipecat dependencies..." -pip install -e ./pipecat[cartesia,deepgram,openai,elevenlabs,groq,google,azure,sarvam,soundfile,silero,webrtc,speechmatics,openrouter,camb] - -echo "Setup complete! Pipecat is now available as a git submodule." \ No newline at end of file diff --git a/scripts/setup_requirements.ps1 b/scripts/setup_requirements.ps1 new file mode 100644 index 0000000..e998d86 --- /dev/null +++ b/scripts/setup_requirements.ps1 @@ -0,0 +1,48 @@ +#!/usr/bin/env pwsh +# Setup script for using pipecat as a git submodule (Windows). +# +# Usage: +# ./scripts/setup_requirements.ps1 # default: install runtime deps +# ./scripts/setup_requirements.ps1 -Dev # also install pipecat dev deps; +# # skips git submodule update (CI +# # already checks out submodules). + +[CmdletBinding()] +param( + [switch]$Dev +) + +$ErrorActionPreference = 'Stop' + +$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path +$BaseDir = Split-Path -Parent $ScriptDir +Set-Location $BaseDir + +Write-Host "Setting up pipecat as a git submodule..." + +if (-not $Dev) { + Write-Host "Initializing git submodules..." + git submodule update --init --recursive +} + +# Install dograh API requirements first so pipecat's extras win on any +# shared transitive dependencies (matches api/Dockerfile and CI workflow). +Write-Host "Installing dograh API requirements..." +pip install -r api/requirements.txt + +if ($Dev) { + Write-Host "Installing dograh API dev requirements..." + pip install -r api/requirements.dev.txt +} + +# Install pipecat in editable mode with all extras +Write-Host "Installing pipecat dependencies..." +pip install -e './pipecat[cartesia,deepgram,openai,elevenlabs,groq,google,azure,sarvam,soundfile,silero,webrtc,speechmatics,openrouter,camb]' + +if ($Dev) { + Write-Host "Installing pipecat dev dependencies..." + pip install --upgrade pip + pip install --group pipecat/pyproject.toml:dev +} + +Write-Host "Setup complete! Pipecat is now available as a git submodule." diff --git a/scripts/setup_requirements.sh b/scripts/setup_requirements.sh new file mode 100755 index 0000000..e0a34f2 --- /dev/null +++ b/scripts/setup_requirements.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# Setup script for using pipecat as a git submodule. +# +# Usage: +# ./scripts/setup_requirements.sh # default: install runtime deps +# ./scripts/setup_requirements.sh --dev # also install pipecat dev deps; +# # skips git submodule update (CI +# # already checks out submodules). + +set -euo pipefail + +DEV_MODE=0 + +while [[ $# -gt 0 ]]; do + case "$1" in + --dev) + DEV_MODE=1 + shift + ;; + *) + echo "Unknown argument: $1" >&2 + echo "Usage: $0 [--dev]" >&2 + exit 1 + ;; + esac +done + +# Get the project root directory (parent of scripts) +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DOGRAH_DIR="$(dirname "$SCRIPT_DIR")" + +cd "$DOGRAH_DIR" + +echo "Setting up pipecat as a git submodule..." + +if [ "$DEV_MODE" -eq 0 ]; then + echo "Initializing git submodules..." + git submodule update --init --recursive +fi + +# Install dograh API requirements first so pipecat's extras win on any +# shared transitive dependencies (matches api/Dockerfile and CI workflow). +echo "Installing dograh API requirements..." +pip install -r api/requirements.txt + +if [ "$DEV_MODE" -eq 1 ]; then + echo "Installing dograh API dev requirements..." + pip install -r api/requirements.dev.txt +fi + +# Install pipecat in editable mode with all extras +echo "Installing pipecat dependencies..." +pip install -e ./pipecat[cartesia,deepgram,openai,elevenlabs,groq,google,azure,sarvam,soundfile,silero,webrtc,speechmatics,openrouter,camb] + +if [ "$DEV_MODE" -eq 1 ]; then + echo "Installing pipecat dev dependencies..." + pip install --upgrade pip + pip install --group pipecat/pyproject.toml:dev +fi + +echo "Setup complete! Pipecat is now available as a git submodule."