Skip to content

Commit

Permalink
Fix the documentation building for latest version of sphinx. (#2958)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelson authored and pp-mo committed Feb 15, 2018
1 parent c0dc72f commit 70a4052
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,14 @@ script:
# the RC, so it's best to start each operation with an absolute cd.
- INSTALL_DIR=$(pwd)

# "make html" produces an error when run on Travis that does not
# affect any downstream functionality but causes the build to fail
# spuriously. The echo-backtick workaround gets around this error,
# which should be investigated further in the future.
- >
if [[ $TEST_TARGET == 'doctest' ]]; then
MPL_RC_DIR=$HOME/.config/matplotlib;
mkdir -p $MPL_RC_DIR;
echo 'backend : agg' > $MPL_RC_DIR/matplotlibrc;
echo 'image.cmap : viridis' >> $MPL_RC_DIR/matplotlibrc;
cd $INSTALL_DIR/docs/iris;
echo `make clean html`;
make clean html;
make doctest;
fi
Expand Down
11 changes: 5 additions & 6 deletions docs/iris/src/sphinxext/gen_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import glob
import re
import warnings

import matplotlib.image as image
from sphinx.util import status_iterator


template = '''\
Expand Down Expand Up @@ -64,8 +66,7 @@ def gen_gallery(app, doctree):
'mathtext_examples',
'matshow_02',
'matshow_03',
'matplotlib_icon',
])
'matplotlib_icon'])

thumbnails = {}
rows = []
Expand Down Expand Up @@ -192,10 +193,8 @@ def gen_gallery(app, doctree):
if regenerate:
with open(gallery_path, 'w') as fh:
fh.write(content)

for key in app.builder.status_iterator(thumbnails,
'generating thumbnails... ',
length=len(thumbnails)):
for key in status_iterator(thumbnails, 'generating thumbnails... ',
length=len(thumbnails)):
image.thumbnail(key, thumbnails[key], 0.3)


Expand Down
2 changes: 1 addition & 1 deletion lib/iris/cube.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2010 - 2017, Met Office
# (C) British Crown Copyright 2010 - 2018, Met Office
#
# This file is part of Iris.
#
Expand Down

0 comments on commit 70a4052

Please sign in to comment.