forked from colonelpanic8/okcupyd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
63 lines (47 loc) · 1.67 KB
/
tasks.py
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
from invoke import Collection, task, run
from okcupyd import tasks
ns = Collection()
ns.add_collection(tasks, name='okcupyd')
@ns.add_task
@task(default=True)
def install():
run("python setup.py install")
@ns.add_task
@task
def pypi():
"""Upload to pypi"""
run("python setup.py sdist upload -r pypi")
@ns.add_task
@task
def rerecord(rest):
"""Rerecord tests."""
run('tox -e py27 -- --cassette-mode all --record --credentials test_credentials {0} -s'
.format(rest), pty=True)
run('tox -e py27 -- --resave --scrub --credentials test_credentials {0} -s'
.format(rest), pty=True)
@ns.add_task
@task(aliases='r')
def rerecord_one(test_name, rest='', pty=False):
run('tox -e py27 -- --cassette-mode all --record --credentials test_credentials -k {0} -s {1}'
.format(test_name, rest), pty=pty)
run('tox -e py27 -- --resave --scrub --credentials test_credentials -k {0} -s {1}'
.format(test_name, rest), pty=pty)
@ns.add_task
@task
def failing_test_names():
run("tox -e py27 | grep test_ | grep \u2015 | sed 's:\\\u2015::g'", pty=True)
@ns.add_task
@task
def rerecord_failing():
result = run("tox -e py27 | grep test_ | grep \u2015 | sed 's:\\\u2015::g'",
hide='out')
for test_name in result.stdout.split('\n'):
rerecord_one(rest=test_name.strip())
linux_dependencies = ('zlib1g-dev', 'libxml2-dev', 'libxslt1-dev', 'python-dev',
'libncurses5-dev')
@ns.add_task
@task(aliases=('linux_dep',))
def install_linux_dependencies():
install_command = 'sudo apt-get install -y'
for package in linux_dependencies:
run('{0} {1}'.format(install_command, package), pty=False)