Skip to content

Commit 0bfb61b

Browse files
DOC: small updates to make.py script (pandas-dev#19951)
* enable passing verbosity flag to sphinx * alias api for api.rst
1 parent d1f3689 commit 0bfb61b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

doc/make.py

+12-5
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ class DocBuilder:
7878
All public methods of this class can be called as parameters of the
7979
script.
8080
"""
81-
def __init__(self, num_jobs=1, include_api=True, single_doc=None):
81+
def __init__(self, num_jobs=1, include_api=True, single_doc=None,
82+
verbosity=0):
8283
self.num_jobs = num_jobs
8384
self.include_api = include_api
85+
self.verbosity = verbosity
8486
self.single_doc = None
8587
self.single_doc_type = None
8688
if single_doc is not None:
@@ -120,7 +122,7 @@ def _process_single_doc(self, single_doc):
120122
"""
121123
self.include_api = False
122124

123-
if single_doc == 'api.rst':
125+
if single_doc == 'api.rst' or single_doc == 'api':
124126
self.single_doc_type = 'api'
125127
self.single_doc = 'api'
126128
elif os.path.exists(os.path.join(SOURCE_PATH, single_doc)):
@@ -229,6 +231,8 @@ def _sphinx_build(self, kind):
229231
self._run_os('sphinx-build',
230232
'-j{}'.format(self.num_jobs),
231233
'-b{}'.format(kind),
234+
'-{}'.format(
235+
'v' * self.verbosity) if self.verbosity else '',
232236
'-d{}'.format(os.path.join(BUILD_PATH, 'doctrees')),
233237
'-Dexclude_patterns={}'.format(self.exclude_patterns),
234238
SOURCE_PATH,
@@ -330,6 +334,9 @@ def main():
330334
type=str,
331335
default=os.path.join(DOC_PATH, '..'),
332336
help='path')
337+
argparser.add_argument('-v', action='count', dest='verbosity', default=0,
338+
help=('increase verbosity (can be repeated), '
339+
'passed to the sphinx build command'))
333340
args = argparser.parse_args()
334341

335342
if args.command not in cmds:
@@ -338,9 +345,9 @@ def main():
338345

339346
os.environ['PYTHONPATH'] = args.python_path
340347

341-
getattr(DocBuilder(args.num_jobs,
342-
not args.no_api,
343-
args.single), args.command)()
348+
builder = DocBuilder(args.num_jobs, not args.no_api, args.single,
349+
args.verbosity)
350+
getattr(builder, args.command)()
344351

345352

346353
if __name__ == '__main__':

0 commit comments

Comments
 (0)