Skip to content

Commit

Permalink
TO SQUASH: Adding argparse support.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Aug 24, 2016
1 parent 7cb7980 commit bf7bd3b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
19 changes: 17 additions & 2 deletions scripts/verify_included_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from __future__ import print_function

import argparse
import os
import sys
import warnings
Expand Down Expand Up @@ -155,6 +156,20 @@ def main(build_root='_build'):
sys.exit(1)


def get_parser():
"""Get simple ``argparse`` parser to determine package.
:rtype: :class:`argparse.ArgumentParser`
:returns: The parser for this script.
"""
parser = argparse.ArgumentParser(
description='Run check that all GCloud modules are included in docs.')
parser.add_argument('--build-root', dest='build_root',
help='The root directory where docs are located.')
return parser


if __name__ == '__main__':
_, build_root = sys.argv
main(build_root=build_root)
parser = get_parser()
args = parser.parse_args()
main(build_root=args.build_root)
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ basepython =
commands =
python -c "import shutil; shutil.rmtree('docs/_build', ignore_errors=True)"
sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
python {toxinidir}/scripts/verify_included_modules.py _build
python {toxinidir}/scripts/verify_included_modules.py --build-root _build
deps =
{[testenv]deps}
{[docs]deps}
Expand Down Expand Up @@ -99,7 +99,7 @@ basepython = {[testenv:docs]basepython}
commands =
python -c "import shutil; shutil.rmtree('docs/_build_rtd', ignore_errors=True)"
sphinx-build -W -b html -d docs/_build_rtd/doctrees docs docs/_build_rtd/html
python {toxinidir}/scripts/verify_included_modules.py _build_rtd
python {toxinidir}/scripts/verify_included_modules.py --build-root _build_rtd
deps =
{[testing]deps}
{[docs]deps}
Expand Down

0 comments on commit bf7bd3b

Please sign in to comment.