Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73f37d7

Browse files
committed
try build gallery and send to rtd again
1 parent cd6e105 commit 73f37d7

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

.github/workflows/build-gallery.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docs
2+
on: [push, release]
3+
4+
jobs:
5+
notebooks:
6+
name: "Build the notebooks for the docs"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
lfs: true
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.11
16+
- name: Install llvmpipe and lavapipe for offscreen canvas
17+
run: |
18+
sudo apt-get update -y -qq
19+
sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers git-lfs
20+
- name: Install dev dependencies
21+
run: |
22+
python -m pip install --upgrade pip setuptools
23+
# remove pygfx from install_requires, we install using pygfx@main
24+
sed -i "/pygfx/d" ./setup.py
25+
pip install git+https://github.com/pygfx/pygfx.git@main
26+
pip install -e ".["tests"]"
27+
- name: Show wgpu backend
28+
run:
29+
python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
30+
- name: make gallery
31+
run: |
32+
RTD_BUILD=1 sphinx-build -b dummy source/ /tmp/
33+
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
name: gallery-${{ github.sha }}
37+
path: docs/source/_gallery
38+
39+
- name: Trigger RTDs build
40+
uses: dfm/rtds-action@v1
41+
with:
42+
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
43+
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
44+
commit_ref: ${{ github.ref }}

docs/source/conf.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,28 @@
4444
"sphinx.ext.viewcode",
4545
"sphinx_copybutton",
4646
"sphinx_design",
47-
"sphinx_gallery.gen_gallery"
47+
"sphinx_gallery.gen_gallery",
48+
"rtds_action",
4849
]
4950

51+
# The name of your GitHub repository
52+
rtds_action_github_repo = "fastplotlib/fastplotlib"
53+
54+
# The path where the artifact should be extracted
55+
# Note: this is relative to the conf.py file!
56+
rtds_action_path = "_gallery"
57+
58+
# The "prefix" used in the `upload-artifact` step of the action
59+
rtds_action_artifact_prefix = "gallery-"
60+
61+
# A GitHub personal access token is required, more info below
62+
rtds_action_github_token = os.environ["GITHUB_TOKEN"]
63+
64+
# Whether or not to raise an error on Read the Docs if the
65+
# artifact containing the notebooks can't be downloaded (optional)
66+
rtds_action_error_if_missing = False
67+
68+
5069
sphinx_gallery_conf = {
5170
"gallery_dirs": "_gallery",
5271
"backreferences_dir": "_gallery/backreferences",

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"sphinx",
1616
"sphinx-gallery",
1717
"furo",
18+
"rtds-action",
1819
"glfw",
1920
"jupyter-rfb>=0.4.1", # required so ImageWidget docs show up
2021
"ipywidgets>=8.0.0,<9",

0 commit comments

Comments
 (0)