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

Skip to content

Commit 2d1e51f

Browse files
authored
Merge pull request #7049 from NelleV/doc_readme
MNT: Documented dependencies to the doc and remove unnecessary dependencies
2 parents 2d9c534 + 633a2e4 commit 2d1e51f

File tree

6 files changed

+69
-97
lines changed

6 files changed

+69
-97
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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Requirements for building docs
2+
# You will first need a matching matplotlib installed
3+
# e.g (from the matplotlib root directory)
4+
# pip install -e .
5+
#
6+
# Install the documentation requirements with:
7+
# pip install -r doc-requirements.txt
8+
#
9+
sphinx>1.0
10+
numpydoc
11+
ipython
12+
mock
13+
colorspacious
14+
pillow

doc/README.txt

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,40 @@
11
maptlotlib documentation
22
========================
33

4+
5+
Building the documentation
6+
--------------------------
7+
8+
A list of dependencies can be found in ../doc-requirements.txt.
9+
10+
All of these dependencies can be installed through pip::
11+
12+
pip install -r ../doc-requirements.txt
13+
14+
or conda::
15+
16+
conda install sphinx numpydoc ipython mock colorspacious pillow
17+
18+
To build the HTML documentation, type ``python make.py html`` in this
19+
directory. The top file of the results will be ./build/html/index.html
20+
21+
**Note that Sphinx uses the installed version of the package to build the
22+
documentation**: matplotlib must be installed *before* the docs can be
23+
generated.
24+
25+
You can build the documentation with several options:
26+
27+
* `--small` saves figures in low resolution.
28+
* `--allowsphinxwarnings`: Don't turn Sphinx warnings into errors.
29+
* `-n N` enables parallel build of the documentation using N process.
30+
31+
Organization
32+
-------------
33+
434
This is the top level build directory for the matplotlib
535
documentation. All of the documentation is written using sphinx, a
636
python documentation system built on top of ReST. This directory contains
737

8-
938
* users - the user documentation, e.g., plotting tutorials, configuration
1039
tips, etc.
1140

@@ -33,21 +62,3 @@ python documentation system built on top of ReST. This directory contains
3362
* mpl_examples - a link to the matplotlib examples in case any
3463
documentation wants to literal include them
3564

36-
To build the HTML documentation, install sphinx (1.0 or greater
37-
required), then type "python make.py html" in this directory. Wait
38-
for the initial run (which builds the example gallery) to be done,
39-
then run "python make.py html" again. The top file of the results will
40-
be ./build/html/index.html
41-
42-
Note that Sphinx uses the installed version of the package to build
43-
the documentation, so matplotlib must be installed *before* the docs
44-
can be generated. Even if that is the case, one of the files needed
45-
to do this, '../lib/matplotlib/mpl-data/matplotlibrc', is not version
46-
controlled, but created when matplotlib is built. This means that the
47-
documentation cannot be generated immediately after checking out the
48-
source code, even if matplotlib is installed on your system: you will
49-
have to run ``python setup.py build`` first.
50-
51-
To build a smaller version of the documentation (without
52-
high-resolution PNGs and PDF examples), type "python make.py --small
53-
html".

doc/conf.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,27 @@
5252
raise ImportError("No module named numpydoc - you need to install "
5353
"numpydoc to build the documentation.")
5454

55+
try:
56+
import colorspacious
57+
except ImportError:
58+
raise ImportError("No module named colorspacious - you need to install "
59+
"colorspacious to build the documentation")
60+
61+
try:
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
72+
except ImportError:
73+
msg = "Error: matplotlib must be installed before building the documentation"
74+
sys.exit(msg)
75+
5576

5677
autosummary_generate = True
5778

@@ -71,17 +92,14 @@
7192

7293
# General substitutions.
7394
project = 'Matplotlib'
74-
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')
7598

7699
# The default replacements for |version| and |release|, also used in various
77100
# other places throughout the built documents.
78101
#
79102
# The short X.Y version.
80-
try:
81-
import matplotlib
82-
except ImportError:
83-
msg = "Error: matplotlib must be installed before building the documentation"
84-
sys.exit(msg)
85103

86104
version = matplotlib.__version__
87105
# The full version, including alpha/beta/rc tags.
@@ -287,11 +305,6 @@
287305
1),
288306
]
289307

290-
try:
291-
from unittest.mock import MagicMock
292-
except:
293-
from mock import MagicMock
294-
295308

296309
class MyWX(MagicMock):
297310
class Panel(object):

doc/pyplots/plotmap.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

doc/users/screenshots.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,6 @@ for both.
183183
See :mod:`matplotlib.ticker` and :mod:`matplotlib.dates` for details and usage.
184184

185185

186-
187-
.. _screenshots_basemap_demo:
188-
189-
Basemap demo
190-
============
191-
192-
Jeff Whitaker's :ref:`toolkit_basemap` add-on toolkit makes it possible to plot data on many different map projections. This example shows how to plot contours, markers and text on an orthographic projection, with NASA's "blue marble" satellite image as a background.
193-
194-
.. plot:: pyplots/plotmap.py
195-
196186
.. _screenshots_log_demo:
197187

198188
Log plots

0 commit comments

Comments
 (0)