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

Skip to content

Commit 05f8434

Browse files
committed
Merge pull request matplotlib#7049 from NelleV/doc_readme
MNT: Documented dependencies to the doc and remove unnecessary dependencies Conflicts: .travis.yml backported master version of conflicts
1 parent ca51e8d commit 05f8434

6 files changed

Lines changed: 72 additions & 105 deletions

File tree

.travis.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,10 @@ install:
7575
pip install --upgrade pip
7676
pip install --upgrade wheel
7777
pip install --upgrade setuptools
78-
# Install only from travis wheelhouse
79-
- if [ -z "$PRE" ]; then
80-
wheelhouse_pip_install python-dateutil $NUMPY $PANDAS pyparsing!=2.1.6 pillow sphinx!=1.3.0;
81-
else
82-
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 pillow sphinx!=1.3.0;
83-
fi
84-
# Always install from pypi
85-
- pip install $PRE pep8 cycler
86-
- 'pip install https://github.com/tacaswell/nose/zipball/mnt_py36_compat#egg=nose'
78+
- |
79+
# Install dependencies from pypi
80+
pip install $PRE python-dateutil $NUMPY pyparsing!=2.1.6 $PANDAS pep8 cycler coveralls coverage
81+
pip install $PRE -r doc-requirements.txt
8782
8883
# Install mock on python 2. Python 2.6 requires mock 1.0.1
8984
# Since later versions have dropped support
@@ -119,13 +114,6 @@ install:
119114
120115
- python setup.py install
121116
- |
122-
# Installing basemap from github until it's back on pypi
123-
# We have to install it after matplotlib to avoid pulling in MPL as
124-
# a dependency
125-
if [[ $BUILD_DOCS == true ]]; then
126-
pip install pyshp!=1.2.8
127-
pip install https://github.com/matplotlib/basemap/tarball/master
128-
fi;
129117
130118
script:
131119
# 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.
@@ -286,11 +304,6 @@
286304
1),
287305
]
288306

289-
try:
290-
from unittest.mock import MagicMock
291-
except:
292-
from mock import MagicMock
293-
294307

295308
class MyWX(MagicMock):
296309
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)