-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdodo.py
39 lines (28 loc) · 952 Bytes
/
dodo.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
import glob
from doitpy.pyflakes import Pyflakes
from doitpy.coverage import PythonModule, Coverage
from doitpy.pypi import PyPi
from doitpy import docs
DOIT_CONFIG = {'default_tasks': ['pyflakes', 'test']}
def task_pyflakes():
yield Pyflakes().tasks('*.py')
def task_test():
"""run unit-test"""
return {
'actions': ['py.test'],
'file_dep': ['doitcmd.py', 'test_doitcmd.py'],
}
def task_coverage():
cov = Coverage([PythonModule('doitcmd.py', 'test_doitcmd.py')])
yield cov.all()
yield cov.src()
def task_docs():
doc_files = glob.glob('doc/*.rst') + ['README.rst']
yield docs.spell(doc_files, 'doc/dictionary.txt')
yield docs.sphinx('doc/', 'doc/_build/html/', task_dep=['spell'])
yield docs.pythonhosted_upload('doc/_build/html/', task_dep=['sphinx'])
def task_pypi():
"""upload package to pypi"""
pkg = PyPi()
yield pkg.manifest_git()
yield pkg.sdist_upload()