22
22
from datetime import datetime
23
23
import time
24
24
25
+ # are we running circle CI?
26
+ CIRCLECI = 'CIRCLECI' in os .environ
27
+
25
28
# Parse year using SOURCE_DATE_EPOCH, falling back to current time.
26
29
# https://reproducible-builds.org/specs/source-date-epoch/
27
30
sourceyear = datetime .utcfromtimestamp (int (os .environ .get ('SOURCE_DATE_EPOCH' , time .time ()))).year
@@ -153,6 +156,7 @@ def _check_dependencies():
153
156
154
157
155
158
# Sphinx gallery configuration
159
+
156
160
sphinx_gallery_conf = {
157
161
'examples_dirs' : ['../examples' , '../tutorials' , '../plot_types' ],
158
162
'filename_pattern' : '^((?!sgskip).)*$' ,
@@ -169,12 +173,11 @@ def _check_dependencies():
169
173
'remove_config_comments' : True ,
170
174
'min_reported_time' : 1 ,
171
175
'thumbnail_size' : (320 , 224 ),
172
- 'compress_images' : ('thumbnails' , 'images' ),
176
+ 'compress_images' : () if CIRCLECI else ( 'thumbnails' , 'images' ),
173
177
'matplotlib_animations' : True ,
174
178
# 3.7 CI doc build should not use hidpi images during the testing phase
175
179
'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 '' ,
178
181
}
179
182
180
183
plot_gallery = 'True'
@@ -286,6 +289,7 @@ def _check_dependencies():
286
289
html_logo = "_static/logo2.svg"
287
290
html_theme_options = {
288
291
"logo_link" : "index" ,
292
+ "collapse_navigation" : True if CIRCLECI else False ,
289
293
"icon_links" : [
290
294
{
291
295
"name" : "gitter" ,
0 commit comments