forked from vendasta/cloudpypi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
56 lines (43 loc) · 943 Bytes
/
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
import os
import sys
import unittest
from invoke import task, run
@task
def clean():
"""
Clean files.
"""
run("find . -iname *.pyc -exec rm -rf {} \;")
@task
def deploy():
"""
Clean files.
"""
run("appcfg.py update cloudpypi")
@task
def flake8():
"""
Run flake8.
"""
run("flake8")
@task
def fetch_deps():
"""
Fetch dependencies and install to lib directory.
"""
run("pip install -r requirements.txt -t ./cloudpypi/lib/")
@task
def test():
"""
Run tests.
"""
if not os.path.isdir('./cloudpypi/lib/'):
fetch_deps()
sys.path.append(os.environ['GAE_SDK_ROOT'])
sys.path.append('./tests/lib/')
sys.path.append('./cloudpypi/lib/')
sys.path.append('./cloudpypi/')
import dev_appserver
dev_appserver.fix_sys_path()
suite = unittest.loader.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(suite)