I am using setuptools to create my sphinx documentation for the python ( python setup.py build_sphinx) project .
As found, for example, this site , I configured the build process using setup.cfg:
[build_sphinx]
source-dir = docs/source
build-dir = docs/build
all_files = 1
However, I would like to add a few more options. In particular, I would like to turn all warnings into errors that will work with the command sphinx-buildwith the option -W:
sphinx-build --help
Sphinx v1.1.3
Usage: /usr/bin/sphinx-build [options] sourcedir outdir [filenames...]
Options: -b <builder> -- builder to use; default is html
-a -- write all files; default is to only write new and changed files
-E -- don't use a saved environment, always read all files
-t <tag> -- include "only" blocks with <tag>
-d <path> -- path for the cached environment and doctree files
(default: outdir/.doctrees)
-c <path> -- path where configuration file (conf.py) is located
(default: same as sourcedir)
-C -- use no config file at all, only -D options
-D <setting=value> -- override a setting in configuration
-A <name=value> -- pass a value into the templates, for HTML builder
-n -- nit-picky mode, warn about all missing references
-N -- do not do colored output
-q -- no output on stdout, just warnings on stderr
-Q -- no output at all, not even warnings
-w <file> -- write warnings (and errors) to given file
-W -- turn warnings into errors
-P -- run Pdb on exception
Modi:
* without -a and without filenames, write new and changed files.
* with -a, write all files.
* with filenames, write these.
I do not see a similar option for python setup.py build_sphinx:
python setup.py build_sphinx
Common commands: (see '
setup.py build will build the package underneath 'build/'
setup.py install will install the package
Global options:
Options for 'BuildDoc' command:
for |today|
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py
or: setup.py
or: setup.py cmd
Does anyone know if all warnings can be made in case of errors when creating an sphinx document using setuptools?
Edit:
The parameter is -Wnot recognized by setuptools:
python setup.py build_sphinx -W
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option -W not recognized