Skip to content

Commit

Permalink
Updated rtd config
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaTegner committed Nov 23, 2024
1 parent 55a66f6 commit b090211
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,35 @@ jobs:
- name: run linting
run: uv run pre-commit run --all-files

docs_teamtalk:
needs: [test]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04 # Any OS is fine as this wheel is not OS dependent
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: 3.11 # Build any 1 python version as this wheel is not version dependent
- name: Install and configure uv
run: |
pip3 install uv
- name: Set up cache
uses: actions/cache@v4
id: cached-uv-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/uv.lock') }}
- name: Install dependencies
run: uv sync --all-extras
if: steps.cached-uv-dependencies.outputs.cache-hit != 'true'
- name: Download TeamTalk SDK
run: uv run python -c "import teamtalk"
- name: Build documentation
run: uv run sphinx-build -b html docs docs/_build/html

builder_teamtalk:
needs: [test]
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
Expand Down
4 changes: 3 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ build:
jobs:
post_install:
- pip install uv
- uv pip install --system pyproject.toml
- uv pip install --all-extras -r pyproject.toml
- python -c "import teamtalk"
- export TT_CI=true

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
4 changes: 4 additions & 0 deletions teamtalk/download_sdk.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"""Download the TeamTalk SDK and extract it to the implementation directory."""

import os
from .tools import ttsdk_downloader


def download_sdk():
"""Download the TeamTalk SDK and extract it to the implementation directory."""
# if the CI environment variable is set, we don't need to download the SDK
if os.environ.get("TT_CI"):
return
ttsdk_downloader.install()
8 changes: 8 additions & 0 deletions teamtalk/tools/ttsdk_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ def install() -> None:
sys.exit(1)
print("Extracted. moving")
move()
# check if the move was successful
if not os.path.exists(os.path.join(cd, "implementation", "TeamTalk_DLL")):
print("Failed to move TeamTalk_DLL")
sys.exit(1)
if not os.path.exists(os.path.join(cd, "implementation", "TeamTalkPy")):
print("Failed to move TeamTalkPy")
sys.exit(1)
print("moved. cleaning")
clean()
print("cleaned.")
print("Installed")
sys.exit(0)

0 comments on commit b090211

Please sign in to comment.