From 8e33bed3f57c7667e132148af76fe646d837e232 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 26 Jan 2020 12:57:57 -0500 Subject: Fixed broken links in Sphinx docs Also: - Added a "linkcheck" task to the invoke tasks _ Use pseudoterminals for invoke tasks with colored output so that we can see the color when using invoke --- tasks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tasks.py') diff --git a/tasks.py b/tasks.py index f7df006b..ed0004a6 100644 --- a/tasks.py +++ b/tasks.py @@ -45,7 +45,7 @@ namespace.add_collection(namespace_clean, 'clean') @invoke.task def pytest(context): "Run tests and code coverage using pytest" - context.run("pytest --cov=cmd2 --cov-report=term --cov-report=html") + context.run("pytest --cov=cmd2 --cov-report=term --cov-report=html", pty=True) namespace.add_task(pytest) @invoke.task @@ -98,7 +98,7 @@ SPHINX_OPTS = '-nvWT' # Be nitpicky, verbose, and treat warnings as errors def docs(context, builder='html'): "Build documentation using sphinx" cmdline = 'python -msphinx -M {} {} {} {}'.format(builder, DOCS_SRCDIR, DOCS_BUILDDIR, SPHINX_OPTS) - context.run(cmdline) + context.run(cmdline, pty=True) namespace.add_task(docs) @invoke.task() @@ -114,6 +114,12 @@ def docs_clean(context): rmrf(DOCS_BUILDDIR) namespace_clean.add_task(docs_clean, name='docs') +@invoke.task() +def linkcheck(context): + """Check external links in Sphinx documentation for integrity.""" + context.run('cd docs && make linkcheck', pty=True) +namespace.add_task(linkcheck) + @invoke.task def livehtml(context): "Launch webserver on http://localhost:8000 with rendered documentation" -- cgit v1.2.1