summaryrefslogtreecommitdiff
path: root/tasks.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-26 12:57:57 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-26 12:57:57 -0500
commit8e33bed3f57c7667e132148af76fe646d837e232 (patch)
treeacab882c27707818b644d1d5c778436d9131c2c0 /tasks.py
parent91ab799f293f0789bbb2759aaabc13c00da36b03 (diff)
downloadcmd2-git-8e33bed3f57c7667e132148af76fe646d837e232.tar.gz
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
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py10
1 files changed, 8 insertions, 2 deletions
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"