Skip to content

Commit 85986c5

Browse files
committed
feat: better stream handling, docs
1 parent f50fb95 commit 85986c5

46 files changed

Lines changed: 3490 additions & 992 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coverage

52 KB
Binary file not shown.

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "uv"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/docs.yml

Lines changed: 66 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,93 @@
1-
name: Documentation
1+
name: Build and Deploy Documentation
2+
23
on:
34
push:
4-
branches:
5-
- main
5+
branches: [main, master]
66
paths:
77
- "docs/**"
88
- "src/**"
9+
- "examples/**"
10+
- "README.md"
911
- "pyproject.toml"
1012
- ".github/workflows/docs.yml"
13+
pull_request:
14+
branches: [main, master]
15+
paths:
16+
- "docs/**"
17+
- "src/**"
18+
- "examples/**"
19+
- "README.md"
20+
- "pyproject.toml"
21+
- ".github/workflows/docs.yml"
22+
workflow_dispatch:
23+
inputs:
24+
reason:
25+
description: "Reason for manual documentation build"
26+
required: false
27+
default: "Manual trigger"
1128

12-
# Sets permissions of the GITHUB_TOKEN
1329
permissions:
14-
contents: write
15-
pull-requests: write
30+
contents: read
31+
pages: write
32+
id-token: write
33+
34+
concurrency:
35+
group: "pages"
36+
cancel-in-progress: false
1637

1738
jobs:
18-
build-docs:
39+
build:
1940
runs-on: ubuntu-latest
2041
steps:
21-
- uses: actions/checkout@v4
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0
2246

2347
- name: Install uv
2448
uses: astral-sh/setup-uv@v6
2549
with:
2650
enable-cache: true
2751

28-
- name: Install dependencies
29-
run: |
30-
uv sync --dev --groups docs
52+
- name: Set up Python
53+
run: uv python install
3154

32-
- name: Configure Git
33-
run: |
34-
git config user.name 'github-actions[bot]'
35-
git config user.email 'github-actions[bot]@users.noreply.github.com'
55+
- name: Install dependencies
56+
run: uv sync --locked --group docs
3657

3758
- name: Build documentation
3859
run: |
3960
cd docs
40-
make clean
41-
make html
61+
uv run make clean
62+
uv run make html
4263
43-
- name: Prepare docs branch
44-
run: |
45-
# Create/switch to docs branch
46-
git checkout -B docs
64+
- name: Setup Pages
65+
uses: actions/configure-pages@v4
66+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
4767

48-
# Remove existing docs if any
49-
rm -rf docs/build || true
50-
51-
# Move built docs to root docs/build directory
52-
mkdir -p docs/build
53-
cp -r docs/_build/html/* docs/build/
54-
55-
# Stage changes
56-
git add docs/build
57-
58-
# Only proceed if there are changes to commit
59-
if git diff --staged --quiet; then
60-
echo "No changes to documentation"
61-
exit 0
62-
fi
63-
64-
# Commit changes
65-
git commit -m "Update documentation from main branch"
66-
67-
# Push to docs branch
68-
git push origin docs --force
69-
70-
- name: Create Pull Request
71-
env:
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73-
run: |
74-
# Check if PR already exists
75-
PR_EXISTS=$(gh pr list --head docs --base main --json number -q length)
76-
77-
if [ "$PR_EXISTS" -eq "0" ]; then
78-
# Create PR if it doesn't exist
79-
gh pr create \
80-
--base main \
81-
--head docs \
82-
--title "Documentation Update" \
83-
--body "Automated documentation update from main branch.
68+
- name: Upload artifact
69+
uses: actions/upload-pages-artifact@v3
70+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
71+
with:
72+
path: docs/_build/html
8473

85-
This PR was automatically generated by the documentation workflow when changes were detected in the docs, source code, or project configuration." \
86-
--label "documentation"
87-
else
88-
echo "PR from docs branch already exists. Skipping PR creation."
89-
fi
74+
- name: Upload build artifacts for debugging
75+
uses: actions/upload-artifact@v4
76+
if: failure()
77+
with:
78+
name: docs-build-artifacts
79+
path: |
80+
docs/_build/
81+
docs/*.log
82+
83+
deploy:
84+
environment:
85+
name: github-pages
86+
url: ${{ steps.deployment.outputs.page_url }}
87+
runs-on: ubuntu-latest
88+
needs: build
89+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
90+
steps:
91+
- name: Deploy to GitHub Pages
92+
id: deployment
93+
uses: actions/deploy-pages@v4

docs/_templates/autosummary/class.rst

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/_templates/autosummary/module.rst

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)