Move API docs generation to docs/api

This commit is contained in:
Mark Backman
2024-12-09 20:39:29 -05:00
parent 61d0fa42f1
commit 2d3864ee09
30 changed files with 18 additions and 17 deletions

View File

@@ -23,12 +23,12 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r docs/requirements.txt pip install -r docs/api/requirements.txt
pip install . pip install .
- name: Generate API documentation - name: Generate API documentation
run: | run: |
cd docs cd docs/api
python generate_docs.py python generate_docs.py
- name: Create Pull Request - name: Create Pull Request
@@ -39,7 +39,7 @@ jobs:
body: | body: |
Automated PR to update API documentation. Automated PR to update API documentation.
- Generated using `generate_docs.py` - Generated using `docs/api/generate_docs.py`
- Triggered by: ${{ github.event_name }} - Triggered by: ${{ github.event_name }}
branch: update-api-docs branch: update-api-docs
delete-branch: true delete-branch: true

4
.gitignore vendored
View File

@@ -34,5 +34,5 @@ fly.toml
pipecat/examples/twilio-chatbot/templates/streams.xml pipecat/examples/twilio-chatbot/templates/streams.xml
# Documentation # Documentation
docs/_build/ docs/api/_build/
docs/api/ docs/api/api

View File

@@ -6,10 +6,10 @@ build:
python: '3.12' python: '3.12'
sphinx: sphinx:
configuration: docs/conf.py configuration: docs/api/conf.py
python: python:
install: install:
- requirements: docs/requirements.txt - requirements: docs/api/requirements.txt
- method: pip - method: pip
path: . path: .

View File

@@ -17,14 +17,14 @@ def run_command(command: list[str]) -> None:
def main(): def main():
docs_dir = Path(__file__).parent docs_dir = Path(__file__).parent
project_root = docs_dir.parent project_root = docs_dir.parent.parent
# Install documentation requirements # Install documentation requirements
requirements_file = docs_dir / "requirements.txt" requirements_file = docs_dir / "requirements.txt"
run_command(["pip", "install", "-r", str(requirements_file)]) run_command(["pip", "install", "-r", str(requirements_file)])
# Install core package # Install from project root, not docs directory
run_command(["pip", "install", "-e", "."]) run_command(["pip", "install", "-e", str(project_root)])
# Install all service dependencies # Install all service dependencies
services = [ services = [
@@ -60,7 +60,7 @@ def main():
extras = ",".join(services) extras = ",".join(services)
try: try:
run_command(["pip", "install", "-e", f".[{extras}]"]) run_command(["pip", "install", "-e", f"{str(project_root)}[{extras}]"])
except Exception as e: except Exception as e:
print(f"Warning: Some dependencies failed to install: {e}") print(f"Warning: Some dependencies failed to install: {e}")
@@ -83,12 +83,13 @@ def main():
str(api_dir), # Output directory str(api_dir), # Output directory
str(project_root / "src/pipecat"), str(project_root / "src/pipecat"),
# Exclude problematic files and directories # Exclude problematic files and directories
"**/processors/gstreamer/*", # Optional gstreamer str(project_root / "src/pipecat/processors/gstreamer"), # Optional gstreamer
"**/transports/network/*", # Pydantic issues str(project_root / "src/pipecat/transports/network"), # Pydantic issues
"**/transports/services/*", # Pydantic issues str(project_root / "src/pipecat/transports/services"), # Pydantic issues
"**/transports/local/*", # Optional dependencies str(project_root / "src/pipecat/transports/local"), # Optional dependencies
"**/services/to_be_updated/*", # Exclude to_be_updated package str(project_root / "src/pipecat/services/to_be_updated"), # Exclude to_be_updated
"**/*test*", # Test files "**/test_*.py", # Test files
"**/tests/*.py", # Test files
] ]
) )

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB