Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .coverage
Binary file not shown.
1 change: 1 addition & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ src/deepgram/core/query_encoder.py

# Hand-written custom tests
tests/custom/test_agent_history.py
tests/custom/test_branch_coverage_95.py
tests/custom/test_compat_aliases.py
tests/custom/test_query_encoder.py
tests/custom/test_secure_logging.py
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push]
on: [push, pull_request]

jobs:
compile:
Expand All @@ -27,6 +27,9 @@ jobs:
run: poetry run mypy src/
test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
Expand All @@ -46,14 +49,38 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Install coverage tool
run: poetry run pip install pytest-cov respx

- name: Verify Docker is available
run: |
docker --version
docker compose version

- name: Test
run: poetry run pytest -rP .
run: poetry run pytest -rP --cov=deepgram --cov-branch --cov-report=xml --cov-report=term-missing .
- name: Generate code coverage summary
if: matrix.python-version == '3.13'
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: coverage.xml
badge: true
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: "75 90"
- name: Add coverage PR comment
if: matrix.python-version == '3.13' && github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: code-coverage
recreate: true
path: code-coverage-results.md
- name: Write coverage to job summary
if: matrix.python-version == '3.13'
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

publish:
needs: [compile, test]
Expand Down
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ markers = [
"aiohttp: tests that require httpx_aiohttp to be installed",
]

[tool.coverage.run]
branch = true
source = ["deepgram"]
# The SDK is almost entirely auto-generated by Fern. Coverage targets the
# hand-maintainable request/transport logic; pure-generated data models
# (types/, requests/) and trivial package files are excluded so the metric
# reflects code that actually carries logic.
omit = [
"*/types/*",
"*/requests/*",
"*/__init__.py",
"*/version.py",
# Unused generated SSE transport scaffolding (no endpoint uses server-sent
# events; only referenced lazily by an optional helper).
"*/core/http_sse/*",
]

[tool.coverage.report]
show_missing = true

[tool.mypy]
plugins = ["pydantic.mypy"]

Expand Down
Loading
Loading