-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpavement.py
46 lines (38 loc) · 963 Bytes
/
pavement.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
#!/usr/bin/python
from paver.easy import *
import paver.doctools
import os
import glob
import shutil
import sys
sys.path.append(os.path.dirname(__file__))
@task
def setup():
sh('python3 setup.py -q install')
pass
@task
def test():
sh('nosetests --with-coverage --cover-erase --cover-branches --cover-html --cover-package=src test')
pass
@task
def clean():
for pycfile in glob.glob("*/*/*.pyc"): os.remove(pycfile)
for pycache in glob.glob("*/__pycache__"): os.removedirs(pycache)
for pycache in glob.glob("./__pycache__"): shutil.rmtree(pycache)
for report in glob.glob('./*.report'):
os.remove(report)
try:
shutil.rmtree(os.getcwd() + "/cover")
except:
pass
pass
@task
def radon():
sh('radon cc src -a -nb')
sh('radon cc src -a -nb > radon.report')
if (os.stat("radon.report").st_size != 0):
raise Exception('radon found complex code')
@task
@needs(['setup', 'clean', 'test', 'radon'])
def default():
pass