Skip to content

Commit ce3bc8b

Browse files
authored
Move docs bulid to Python 3.13 and remove method that was removed in napari 0.6 (#242)
Closes #241
2 parents 6a90c00 + 625f472 commit ce3bc8b

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

.github/workflows/deploy_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3232
with:
33-
python-version: "3.10"
33+
python-version: "3.13"
3434

3535
- uses: tlambert03/setup-qt-libs@19e4ef2d781d81f5f067182e228b54ec90d23b76 # v1.8
3636

docs/conf.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import imageio.v2 as iio
2222
import napari
23+
from napari.settings import get_settings
24+
from qtpy.QtWidgets import QApplication
2325
from sphinx_gallery import scrapers
2426
from sphinx_gallery.sorting import ExampleTitleSortKey
2527

@@ -248,14 +250,11 @@ def napari_scraper(block, block_vars, gallery_conf):
248250
249251
Looks for any QtMainWindow instances and takes a screenshot of them.
250252
251-
`app.processEvents()` allows Qt events to propagateo and prevents hanging.
253+
`processEvents()` allows Qt events to propagate and prevents hanging.
252254
"""
253255
imgpath_iter = block_vars["image_path_iterator"]
254256

255-
if app := napari.qt.get_app():
256-
app.processEvents()
257-
else:
258-
return ""
257+
QApplication.processEvents()
259258

260259
img_paths = []
261260
for win, img_path in zip(
@@ -267,15 +266,12 @@ def napari_scraper(block, block_vars, gallery_conf):
267266
win._window.screenshot(img_path, canvas_only=False)
268267

269268
napari.Viewer.close_all()
270-
app.processEvents()
269+
QApplication.processEvents()
271270

272271
return scrapers.figure_rst(img_paths, gallery_conf["src_dir"])
273272

274273

275274
def reset_napari(gallery_conf, fname):
276-
from napari.settings import get_settings
277-
from qtpy.QtWidgets import QApplication
278-
279275
settings = get_settings()
280276
settings.appearance.theme = "dark"
281277

0 commit comments

Comments
 (0)