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

Skip to content

Commit faec918

Browse files
committed
DOC documents the requirements.txt & updates travis
- This PR documents the doc-requirements file and updates travis to use this file during the installation process. - Added pillow requirements. - Cleaned up conf.py a bit.
1 parent 363ce54 commit faec918

File tree

4 files changed

+21
-31
lines changed

4 files changed

+21
-31
lines changed

.travis.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ install:
113113
- |
114114
# Install dependencies from pypi
115115
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS pep8 cycler coveralls coverage
116-
pip install $PRE pillow sphinx!=1.3.0 $MOCK numpydoc ipython colorspacious
116+
pip install $PRE -r doc-requirements.txt
117117
118118
# Install nose from a build which has partial
119119
# support for python36 and suport for coverage output suppressing
@@ -142,13 +142,6 @@ install:
142142
# Install matplotlib
143143
pip install -e .
144144
- |
145-
# Installing basemap from github until it's back on pypi
146-
# We have to install it after matplotlib to avoid pulling in MPL as
147-
# a dependency
148-
if [[ $BUILD_DOCS == true ]]; then
149-
pip install pyshp!=1.2.8
150-
pip install git+https://github.com/matplotlib/basemap.git
151-
fi;
152145
153146
script:
154147
# The number of processes is hardcoded, because using too many causes the

doc-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ numpydoc
1111
ipython
1212
mock
1313
colorspacious
14+
pillow

doc/README.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,15 @@ maptlotlib documentation
55
Building the documentation
66
--------------------------
77

8-
Dependencies:
9-
10-
* sphinx > 1.0
11-
* numpydoc
12-
* ipython
13-
* mock
14-
* colorspacious
8+
A list of dependencies can be found in ../doc-requirements.txt.
159

1610
All of these dependencies can be installed through pip::
1711

18-
pip install sphinx numpydoc ipython mock colorspacious
12+
pip install -r ../doc-requirements.txt
1913

2014
or conda::
2115

22-
conda install sphinx numpydoc ipython mock colorspacious
16+
conda install sphinx numpydoc ipython mock colorspacious pillow
2317

2418
To build the HTML documentation, type ``python make.py html`` in this
2519
directory. The top file of the results will be ./build/html/index.html

doc/conf.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,20 @@
5959
"colorspacious to build the documentation")
6060

6161
try:
62-
import mock
62+
from unittest.mock import MagicMock
63+
except ImportError:
64+
try:
65+
from mock import MagicMock
66+
except ImportError:
67+
raise ImportError("No module named mock - you need to install "
68+
"mock to build the documentation")
69+
70+
try:
71+
import matplotlib
6372
except ImportError:
64-
raise ImportError("No module named mock - you need to install "
65-
"mock to build the documentation")
73+
msg = "Error: matplotlib must be installed before building the documentation"
74+
sys.exit(msg)
75+
6676

6777
autosummary_generate = True
6878

@@ -82,17 +92,14 @@
8292

8393
# General substitutions.
8494
project = 'Matplotlib'
85-
copyright = '2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team; 2012 - 2014 The matplotlib development team'
95+
copyright = ('2002 - 2012 John Hunter, Darren Dale, Eric Firing, '
96+
'Michael Droettboom and the matplotlib development '
97+
'team; 2012 - 2016 The matplotlib development team')
8698

8799
# The default replacements for |version| and |release|, also used in various
88100
# other places throughout the built documents.
89101
#
90102
# The short X.Y version.
91-
try:
92-
import matplotlib
93-
except ImportError:
94-
msg = "Error: matplotlib must be installed before building the documentation"
95-
sys.exit(msg)
96103

97104
version = matplotlib.__version__
98105
# The full version, including alpha/beta/rc tags.
@@ -298,11 +305,6 @@
298305
1),
299306
]
300307

301-
try:
302-
from unittest.mock import MagicMock
303-
except:
304-
from mock import MagicMock
305-
306308

307309
class MyWX(MagicMock):
308310
class Panel(object):

0 commit comments

Comments
 (0)