forked from pyinvoke/invoke
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
74 lines (61 loc) · 1.97 KB
/
tasks.py
File metadata and controls
74 lines (61 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import os
from os.path import join
import shutil
from invocations import docs as _docs
from invocations.testing import test
from invocations.packaging import vendorize, release
from invoke import ctask as task, run, Collection
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'),
})
@task
def vendorize_pexpect(ctx, version):
target = 'invoke/vendor'
package = 'pexpect'
vendorize(
distribution="pexpect-u",
package=package,
version=version,
vendor_dir=target,
license='LICENSE', # TODO: autodetect this in vendorize
)
# Nuke test dir inside package hrrgh
shutil.rmtree(os.path.join(target, package, 'tests'))
@task(help=test.help)
def integration(c, module=None, runner=None, opts=None):
"""
Run the integration test suite. May be slow!
"""
opts = opts or ""
opts += " --tests=integration/"
test(c, module, runner, opts)
@task
def sites(c):
"""
Builds both doc sites w/ maxed nitpicking.
"""
# Turn warnings into errors, emit warnings about missing references.
# This gives us a maximally noisy docs build.
# Also enable tracebacks for easier debuggage.
opts = "-W -n -T"
# This is super lolzy but we haven't actually tackled nontrivial in-Python
# task calling yet, so...
docs_c, www_c = c.clone(), c.clone()
docs_c.update(**docs.configuration())
www_c.update(**www.configuration())
docs['build'](docs_c, opts=opts)
www['build'](www_c, opts=opts)
ns = Collection(
test, integration, vendorize, release, www, docs, sites, vendorize_pexpect
)