2014-03-03 21:22:44 -05:00
|
|
|
from os import mkdir
|
2014-01-21 19:59:21 -05:00
|
|
|
from os.path import join
|
2014-03-03 21:22:44 -05:00
|
|
|
from shutil import rmtree, copytree
|
2014-01-21 19:59:21 -05:00
|
|
|
|
2014-02-10 21:21:29 -05:00
|
|
|
from invoke import Collection, ctask as task
|
2014-02-10 21:03:25 -05:00
|
|
|
from invocations import docs as _docs
|
2014-03-03 20:27:10 -05:00
|
|
|
from invocations.packaging import publish
|
2014-01-21 19:59:21 -05:00
|
|
|
|
2014-01-10 22:26:04 -05:00
|
|
|
|
2014-01-21 19:59:21 -05:00
|
|
|
d = 'sites'
|
2014-01-10 23:07:43 -05:00
|
|
|
|
2014-01-21 19:59:21 -05:00
|
|
|
# Usage doc/API site (published as docs.paramiko.org)
|
2014-03-03 20:27:10 -05:00
|
|
|
docs_path = join(d, 'docs')
|
|
|
|
docs_build = join(docs_path, '_build')
|
2014-01-21 19:59:21 -05:00
|
|
|
docs = Collection.from_module(_docs, name='docs', config={
|
2014-03-03 20:27:10 -05:00
|
|
|
'sphinx.source': docs_path,
|
|
|
|
'sphinx.target': docs_build,
|
2014-01-10 22:26:04 -05:00
|
|
|
})
|
2014-01-21 19:59:21 -05:00
|
|
|
|
|
|
|
# Main/about/changelog site ((www.)?paramiko.org)
|
2014-03-03 20:27:10 -05:00
|
|
|
www_path = join(d, 'www')
|
2014-01-21 19:59:21 -05:00
|
|
|
www = Collection.from_module(_docs, name='www', config={
|
2014-03-03 20:27:10 -05:00
|
|
|
'sphinx.source': www_path,
|
|
|
|
'sphinx.target': join(www_path, '_build'),
|
2014-01-10 22:26:04 -05:00
|
|
|
})
|
|
|
|
|
2014-02-10 21:03:25 -05:00
|
|
|
|
|
|
|
# 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")
|
|
|
|
|
2014-02-10 21:03:25 -05:00
|
|
|
|
2014-03-03 20:27:10 -05:00
|
|
|
# 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)
|
2014-03-03 20:27:10 -05:00
|
|
|
# Publish
|
2014-03-22 21:17:44 -04:00
|
|
|
publish(ctx, wheel=True)
|
2014-03-03 20:27:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
ns = Collection(test, coverage, release, docs=docs, www=www)
|