paramiko/tasks.py

50 lines
1.3 KiB
Python
Raw Normal View History

2014-03-03 21:22:44 -05:00
from os import mkdir
from os.path import join
2014-03-03 21:22:44 -05:00
from shutil import rmtree, copytree
2014-02-10 21:21:29 -05:00
from invoke import Collection, ctask as task
from invocations import docs as _docs
from invocations.packaging import publish
d = 'sites'
2014-01-10 23:07:43 -05:00
# 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")
2014-02-11 12:31:43 -05:00
@task
def coverage(ctx):
ctx.run("coverage run --source=paramiko test.py --verbose")
# Until we stop bundling docs w/ releases. Need to discover use cases first.
@task('docs') # Will invoke the API doc site build
def release(ctx):
# Move the built docs into where Epydocs used to live
2014-03-03 21:22:44 -05:00
target = 'docs'
rmtree(target, ignore_errors=True)
copytree(docs_build, target)
# Publish
publish(ctx, wheel=True)
ns = Collection(test, coverage, release, docs=docs, www=www)