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

Skip to content

Commit 8fc2703

Browse files
committed
hack to suppress sphinx-gallery 17.0 warning
1 parent 725ee99 commit 8fc2703

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import logging
1616
import os
1717
from pathlib import Path
18+
import re
1819
import shutil
1920
import subprocess
2021
import sys
@@ -201,6 +202,17 @@ def _check_dependencies():
201202
warnings.filterwarnings('ignore', category=UserWarning,
202203
message=r'(\n|.)*is non-interactive, and thus cannot be shown')
203204

205+
206+
# hack to catch sphinx-gallery 17.0 warnings
207+
def tutorials_download_error(record):
208+
if re.match("download file not readable: .*tutorials_(python|jupyter).zip",
209+
record.msg):
210+
return False
211+
212+
213+
logger = logging.getLogger('sphinx')
214+
logger.addFilter(tutorials_download_error)
215+
204216
autosummary_generate = True
205217
autodoc_typehints = "none"
206218

0 commit comments

Comments
 (0)