From 2d3864ee09f6d19a8efa01d7b30a6abac8bf8c11 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 9 Dec 2024 20:39:29 -0500 Subject: [PATCH] Move API docs generation to docs/api --- .github/workflows/generate_docs.yaml | 6 ++--- .gitignore | 4 ++-- .readthedocs.yaml | 4 ++-- {docs-old => docs}/ISSUE_TEMPLATE.md | 0 {docs-old => docs}/PULL_REQUEST_TEMPLATE.md | 0 {docs-old => docs}/README.md | 0 docs/{ => api}/Makefile | 0 docs/{ => api}/conf.py | 0 docs/{ => api}/generate_docs.py | 21 +++++++++--------- docs/{ => api}/index.rst | 0 docs/{ => api}/make.bat | 0 docs/{ => api}/requirements.txt | 0 {docs-old => docs}/architecture.md | 0 {docs-old => docs}/frame-progress.md | 0 {docs-old => docs}/frame.md | 0 .../images/frame-progress-01.png | Bin .../images/frame-progress-02.png | Bin .../images/frame-progress-03.png | Bin .../images/frame-progress-04.png | Bin .../images/frame-progress-05.png | Bin .../images/frame-progress-06.png | Bin .../images/frame-progress-07.png | Bin .../images/frame-progress-08.png | Bin .../images/frame-progress-09.png | Bin .../images/frame-progress-10.png | Bin .../images/frame-progress-11.png | Bin .../images/frame-progress-12.png | Bin .../images/frame-progress-13.png | Bin .../images/frame-progress-14.png | Bin .../images/frame-progress-15.png | Bin 30 files changed, 18 insertions(+), 17 deletions(-) rename {docs-old => docs}/ISSUE_TEMPLATE.md (100%) rename {docs-old => docs}/PULL_REQUEST_TEMPLATE.md (100%) rename {docs-old => docs}/README.md (100%) rename docs/{ => api}/Makefile (100%) rename docs/{ => api}/conf.py (100%) rename docs/{ => api}/generate_docs.py (75%) rename docs/{ => api}/index.rst (100%) rename docs/{ => api}/make.bat (100%) rename docs/{ => api}/requirements.txt (100%) rename {docs-old => docs}/architecture.md (100%) rename {docs-old => docs}/frame-progress.md (100%) rename {docs-old => docs}/frame.md (100%) rename {docs-old => docs}/images/frame-progress-01.png (100%) rename {docs-old => docs}/images/frame-progress-02.png (100%) rename {docs-old => docs}/images/frame-progress-03.png (100%) rename {docs-old => docs}/images/frame-progress-04.png (100%) rename {docs-old => docs}/images/frame-progress-05.png (100%) rename {docs-old => docs}/images/frame-progress-06.png (100%) rename {docs-old => docs}/images/frame-progress-07.png (100%) rename {docs-old => docs}/images/frame-progress-08.png (100%) rename {docs-old => docs}/images/frame-progress-09.png (100%) rename {docs-old => docs}/images/frame-progress-10.png (100%) rename {docs-old => docs}/images/frame-progress-11.png (100%) rename {docs-old => docs}/images/frame-progress-12.png (100%) rename {docs-old => docs}/images/frame-progress-13.png (100%) rename {docs-old => docs}/images/frame-progress-14.png (100%) rename {docs-old => docs}/images/frame-progress-15.png (100%) diff --git a/.github/workflows/generate_docs.yaml b/.github/workflows/generate_docs.yaml index d25b461bf..242984d8a 100644 --- a/.github/workflows/generate_docs.yaml +++ b/.github/workflows/generate_docs.yaml @@ -23,12 +23,12 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r docs/requirements.txt + pip install -r docs/api/requirements.txt pip install . - name: Generate API documentation run: | - cd docs + cd docs/api python generate_docs.py - name: Create Pull Request @@ -39,7 +39,7 @@ jobs: body: | Automated PR to update API documentation. - - Generated using `generate_docs.py` + - Generated using `docs/api/generate_docs.py` - Triggered by: ${{ github.event_name }} branch: update-api-docs delete-branch: true diff --git a/.gitignore b/.gitignore index 97bdc92c4..50944a3a8 100644 --- a/.gitignore +++ b/.gitignore @@ -34,5 +34,5 @@ fly.toml pipecat/examples/twilio-chatbot/templates/streams.xml # Documentation -docs/_build/ -docs/api/ \ No newline at end of file +docs/api/_build/ +docs/api/api \ No newline at end of file diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 8cf3196ca..667e789d9 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,10 +6,10 @@ build: python: '3.12' sphinx: - configuration: docs/conf.py + configuration: docs/api/conf.py python: install: - - requirements: docs/requirements.txt + - requirements: docs/api/requirements.txt - method: pip path: . diff --git a/docs-old/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md similarity index 100% rename from docs-old/ISSUE_TEMPLATE.md rename to docs/ISSUE_TEMPLATE.md diff --git a/docs-old/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from docs-old/PULL_REQUEST_TEMPLATE.md rename to docs/PULL_REQUEST_TEMPLATE.md diff --git a/docs-old/README.md b/docs/README.md similarity index 100% rename from docs-old/README.md rename to docs/README.md diff --git a/docs/Makefile b/docs/api/Makefile similarity index 100% rename from docs/Makefile rename to docs/api/Makefile diff --git a/docs/conf.py b/docs/api/conf.py similarity index 100% rename from docs/conf.py rename to docs/api/conf.py diff --git a/docs/generate_docs.py b/docs/api/generate_docs.py similarity index 75% rename from docs/generate_docs.py rename to docs/api/generate_docs.py index e68e3429c..972ea3c89 100644 --- a/docs/generate_docs.py +++ b/docs/api/generate_docs.py @@ -17,14 +17,14 @@ def run_command(command: list[str]) -> None: def main(): docs_dir = Path(__file__).parent - project_root = docs_dir.parent + project_root = docs_dir.parent.parent # Install documentation requirements requirements_file = docs_dir / "requirements.txt" run_command(["pip", "install", "-r", str(requirements_file)]) - # Install core package - run_command(["pip", "install", "-e", "."]) + # Install from project root, not docs directory + run_command(["pip", "install", "-e", str(project_root)]) # Install all service dependencies services = [ @@ -60,7 +60,7 @@ def main(): extras = ",".join(services) try: - run_command(["pip", "install", "-e", f".[{extras}]"]) + run_command(["pip", "install", "-e", f"{str(project_root)}[{extras}]"]) except Exception as e: print(f"Warning: Some dependencies failed to install: {e}") @@ -83,12 +83,13 @@ def main(): str(api_dir), # Output directory str(project_root / "src/pipecat"), # Exclude problematic files and directories - "**/processors/gstreamer/*", # Optional gstreamer - "**/transports/network/*", # Pydantic issues - "**/transports/services/*", # Pydantic issues - "**/transports/local/*", # Optional dependencies - "**/services/to_be_updated/*", # Exclude to_be_updated package - "**/*test*", # Test files + str(project_root / "src/pipecat/processors/gstreamer"), # Optional gstreamer + str(project_root / "src/pipecat/transports/network"), # Pydantic issues + str(project_root / "src/pipecat/transports/services"), # Pydantic issues + str(project_root / "src/pipecat/transports/local"), # Optional dependencies + str(project_root / "src/pipecat/services/to_be_updated"), # Exclude to_be_updated + "**/test_*.py", # Test files + "**/tests/*.py", # Test files ] ) diff --git a/docs/index.rst b/docs/api/index.rst similarity index 100% rename from docs/index.rst rename to docs/api/index.rst diff --git a/docs/make.bat b/docs/api/make.bat similarity index 100% rename from docs/make.bat rename to docs/api/make.bat diff --git a/docs/requirements.txt b/docs/api/requirements.txt similarity index 100% rename from docs/requirements.txt rename to docs/api/requirements.txt diff --git a/docs-old/architecture.md b/docs/architecture.md similarity index 100% rename from docs-old/architecture.md rename to docs/architecture.md diff --git a/docs-old/frame-progress.md b/docs/frame-progress.md similarity index 100% rename from docs-old/frame-progress.md rename to docs/frame-progress.md diff --git a/docs-old/frame.md b/docs/frame.md similarity index 100% rename from docs-old/frame.md rename to docs/frame.md diff --git a/docs-old/images/frame-progress-01.png b/docs/images/frame-progress-01.png similarity index 100% rename from docs-old/images/frame-progress-01.png rename to docs/images/frame-progress-01.png diff --git a/docs-old/images/frame-progress-02.png b/docs/images/frame-progress-02.png similarity index 100% rename from docs-old/images/frame-progress-02.png rename to docs/images/frame-progress-02.png diff --git a/docs-old/images/frame-progress-03.png b/docs/images/frame-progress-03.png similarity index 100% rename from docs-old/images/frame-progress-03.png rename to docs/images/frame-progress-03.png diff --git a/docs-old/images/frame-progress-04.png b/docs/images/frame-progress-04.png similarity index 100% rename from docs-old/images/frame-progress-04.png rename to docs/images/frame-progress-04.png diff --git a/docs-old/images/frame-progress-05.png b/docs/images/frame-progress-05.png similarity index 100% rename from docs-old/images/frame-progress-05.png rename to docs/images/frame-progress-05.png diff --git a/docs-old/images/frame-progress-06.png b/docs/images/frame-progress-06.png similarity index 100% rename from docs-old/images/frame-progress-06.png rename to docs/images/frame-progress-06.png diff --git a/docs-old/images/frame-progress-07.png b/docs/images/frame-progress-07.png similarity index 100% rename from docs-old/images/frame-progress-07.png rename to docs/images/frame-progress-07.png diff --git a/docs-old/images/frame-progress-08.png b/docs/images/frame-progress-08.png similarity index 100% rename from docs-old/images/frame-progress-08.png rename to docs/images/frame-progress-08.png diff --git a/docs-old/images/frame-progress-09.png b/docs/images/frame-progress-09.png similarity index 100% rename from docs-old/images/frame-progress-09.png rename to docs/images/frame-progress-09.png diff --git a/docs-old/images/frame-progress-10.png b/docs/images/frame-progress-10.png similarity index 100% rename from docs-old/images/frame-progress-10.png rename to docs/images/frame-progress-10.png diff --git a/docs-old/images/frame-progress-11.png b/docs/images/frame-progress-11.png similarity index 100% rename from docs-old/images/frame-progress-11.png rename to docs/images/frame-progress-11.png diff --git a/docs-old/images/frame-progress-12.png b/docs/images/frame-progress-12.png similarity index 100% rename from docs-old/images/frame-progress-12.png rename to docs/images/frame-progress-12.png diff --git a/docs-old/images/frame-progress-13.png b/docs/images/frame-progress-13.png similarity index 100% rename from docs-old/images/frame-progress-13.png rename to docs/images/frame-progress-13.png diff --git a/docs-old/images/frame-progress-14.png b/docs/images/frame-progress-14.png similarity index 100% rename from docs-old/images/frame-progress-14.png rename to docs/images/frame-progress-14.png diff --git a/docs-old/images/frame-progress-15.png b/docs/images/frame-progress-15.png similarity index 100% rename from docs-old/images/frame-progress-15.png rename to docs/images/frame-progress-15.png