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

Skip to content

Commit b4b1f64

Browse files
committed
Default to -W.
1 parent 8886a19 commit b4b1f64

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ mpl-run: &mpl-install
6868

6969
doc-run: &doc-build
7070
name: Build documentation
71-
command: make O=-W html
71+
command: make html
7272
working_directory: doc
7373

7474
doc-bundle-run: &doc-bundle

doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS =
5+
SPHINXOPTS = -W
66
SPHINXBUILD = python -msphinx
77
SPHINXPROJ = matplotlib
88
SOURCEDIR = .

doc/devel/documenting_mpl.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,24 @@ Other useful invocations include
8787
# Build pdf docs.
8888
make latexpdf
8989
90-
You can build the documentation with several options:
90+
The ``SPHINXOPTS`` variable is set to ``-W`` by default to turn warnings into
91+
errors. To unset it, use
9192

92-
* ``make O=-W html`` turns Sphinx warnings into errors. The continuous
93-
integration script uses this option.
94-
* ``make O=-j4 html`` (for example) runs a parallel build with 4 processes.
93+
.. code-block:: sh
94+
95+
make SPHINXOPTS= html
96+
97+
You can use the ``O`` variable to set additional options:
98+
99+
* ``make O=-j4 html`` runs a parallel build with 4 processes.
95100
* ``make O=-Dplot_formats=png:100 html`` saves figures in low resolution.
96101
* ``make O=-Dplot_gallery=0 html`` skips the gallery build.
97102

98-
Multiple options can be combined using e.g. ``make O='-W -j4 ...' html``. On
99-
Windows, the option needs to be set as the ``SPHINXOPTS`` environment
100-
variable, e.g. ``set SPHINXOPTS=-W -j4 & make html``.
103+
Multiple options can be combined using e.g. ``make O='-j4 -Dplot_gallery=0'
104+
html``.
105+
106+
On Windows, options needs to be set as environment variables, e.g. ``set O=-W
107+
-j4 & make html``.
101108

102109
Writing new documentation
103110
=========================

doc/make.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ if "%SPHINXBUILD%" == "" (
1010
set SOURCEDIR=.
1111
set BUILDDIR=build
1212
set SPHINXPROJ=matplotlib
13+
set SPHINXOPTS=-W
14+
set O=
1315

1416
%SPHINXBUILD% >NUL 2>NUL
1517
if errorlevel 9009 (
@@ -26,11 +28,11 @@ if errorlevel 9009 (
2628

2729
if "%1" == "" goto help
2830

29-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
31+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3032
goto end
3133

3234
:help
33-
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
35+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3436

3537
:end
3638
popd

0 commit comments

Comments
 (0)