diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2015-11-03 16:20:45 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2015-11-03 16:20:45 -0800 |
commit | e8142be57cc9f5f216f24cc48656c58b70c5d59a (patch) | |
tree | 3296d24f3d58a02ad294250c49fe7124091ad96b /tasks.py | |
parent | 94c20181dd8073e0cdbc83973c87e89c5f472d80 (diff) | |
parent | 16c106e6aac64424b554b33d269eee80ebb1db7a (diff) |
Merge branch 'master' into 502-int
Diffstat (limited to 'tasks.py')
-rw-r--r-- | tasks.py | 37 |
1 files changed, 13 insertions, 24 deletions
@@ -3,32 +3,20 @@ from os.path import join from shutil import rmtree, copytree from invoke import Collection, ctask as task -from invocations import docs as _docs +from invocations.docs import docs, www, sites from invocations.packaging import publish -d = 'sites' - -# Usage doc/API site (published as docs.paramiko.org) -docs_path = join(d, 'docs') -docs_build = join(docs_path, '_build') -docs = Collection.from_module(_docs, name='docs', config={ - 'sphinx.source': docs_path, - 'sphinx.target': docs_build, -}) - -# Main/about/changelog site ((www.)?paramiko.org) -www_path = join(d, 'www') -www = Collection.from_module(_docs, name='www', config={ - 'sphinx.source': www_path, - 'sphinx.target': join(www_path, '_build'), -}) - - # Until we move to spec-based testing @task -def test(ctx): - ctx.run("python test.py --verbose", pty=True) +def test(ctx, coverage=False, flags=""): + if "--verbose" not in flags.split(): + flags += " --verbose" + runner = "python" + if coverage: + runner = "coverage run --source=paramiko" + ctx.run("{0} test.py {1}".format(runner, flags), pty=True) + @task def coverage(ctx): @@ -43,11 +31,12 @@ def release(ctx): # Move the built docs into where Epydocs used to live target = 'docs' rmtree(target, ignore_errors=True) - copytree(docs_build, target) + # TODO: make it easier to yank out this config val from the docs coll + copytree('sites/docs/_build', target) # Publish - publish(ctx, wheel=True) + publish(ctx) # Remind print("\n\nDon't forget to update RTD's versions page for new minor releases!") -ns = Collection(test, coverage, release, docs=docs, www=www) +ns = Collection(test, coverage, release, docs, www, sites) |