2222from datetime import datetime
2323import time
2424
25+ # are we running circle CI?
26+ CIRCLECI = 'CIRCLECI' in os .environ
27+
2528# Parse year using SOURCE_DATE_EPOCH, falling back to current time.
2629# https://reproducible-builds.org/specs/source-date-epoch/
2730sourceyear = datetime .utcfromtimestamp (int (os .environ .get ('SOURCE_DATE_EPOCH' , time .time ()))).year
@@ -153,6 +156,7 @@ def _check_dependencies():
153156
154157
155158# Sphinx gallery configuration
159+
156160sphinx_gallery_conf = {
157161 'examples_dirs' : ['../examples' , '../tutorials' , '../plot_types' ],
158162 'filename_pattern' : '^((?!sgskip).)*$' ,
@@ -169,12 +173,11 @@ def _check_dependencies():
169173 'remove_config_comments' : True ,
170174 'min_reported_time' : 1 ,
171175 'thumbnail_size' : (320 , 224 ),
172- 'compress_images' : ('thumbnails' , 'images' ),
176+ 'compress_images' : () if CIRCLECI else ( 'thumbnails' , 'images' ),
173177 'matplotlib_animations' : True ,
174178 # 3.7 CI doc build should not use hidpi images during the testing phase
175179 'image_srcset' : [] if sys .version_info [:2 ] == (3 , 7 ) else ["2x" ],
176- 'junit' : ('../test-results/sphinx-gallery/junit.xml'
177- if 'CIRCLECI' in os .environ else '' ),
180+ 'junit' : '../test-results/sphinx-gallery/junit.xml' if CIRCLECI else '' ,
178181}
179182
180183plot_gallery = 'True'
@@ -286,6 +289,7 @@ def _check_dependencies():
286289html_logo = "_static/logo2.svg"
287290html_theme_options = {
288291 "logo_link" : "index" ,
292+ "collapse_navigation" : True if CIRCLECI else False ,
289293 "icon_links" : [
290294 {
291295 "name" : "gitter" ,
0 commit comments