Skip to content

Commit 092017d

Browse files
committed
Fix JB2 in CI
1 parent d7c3c5f commit 092017d

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,43 @@ jobs:
1919
environment:
2020
name: github-pages
2121
url: ${{ steps.deployment.outputs.page_url }}
22+
defaults:
23+
run:
24+
shell: bash -leo pipefail {0}
2225
runs-on: ubuntu-latest
2326
steps:
2427
- uses: actions/checkout@v5
2528

2629
- name: Set up Pages
2730
uses: actions/configure-pages@v5
2831

29-
- name: Set up Python
32+
- name: Set up conda env
3033
uses: mamba-org/setup-micromamba@v2
3134
with:
3235
environment-file: environment.yml
3336
cache-environment: true
37+
# create-args: >-
38+
# ipywidgets
39+
# trame
40+
# trame-vtk
41+
# trame-vuetify
42+
43+
- name: Install JB2
44+
run: python -m pip install -U --pre "jupyter-book==2.*" --no-deps -v
45+
46+
- name: Set up PyVista
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y libgl1-mesa-glx xvfb
50+
51+
# JB2 has --execute, but this way we can see how long it takes
52+
- name: Execute the notebook
53+
run: xvfb-run -a jupyter nbconvert --to notebook --execute --inplace 03-viz.ipynb
54+
env:
55+
PYVISTA_OFF_SCREEN: true
3456

3557
- name: Build HTML
36-
run: jupyter-book build --html --execute --strict --ci
37-
shell: micromamba-shell {0}
58+
run: jupyter book build --html --strict --ci
3859

3960
- name: Upload artifact
4061
uses: actions/upload-pages-artifact@v4

03-viz.ipynb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"title: Viz\n",
1616
"subtitle: Visualizing native-grid output in Python\n",
1717
"label: page:viz\n",
18+
"kernelspec:\n",
19+
" name: python3\n",
1820
"---"
1921
]
2022
},
@@ -76,7 +78,10 @@
7678
"import xarray as xr\n",
7779
"\n",
7880
"# https://docs.pyvista.org/user-guide/jupyter/index.html\n",
81+
"# if os.environ.get(\"CI\", \"true\") == \"true\":\n",
82+
"# pv.start_xvfb()\n",
7983
"pv.set_jupyter_backend(\"static\")\n",
84+
"# pv.set_jupyter_backend(\"html\")\n",
8085
"\n",
8186
"_ = xr.set_options(display_expand_data=False)"
8287
]

0 commit comments

Comments
 (0)