forked from miyakogi/pyppeteer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dodo.py
92 lines (70 loc) · 1.72 KB
/
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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Doit task definitions."""
import multiprocessing
from doit.action import CmdAction
cores = multiprocessing.cpu_count()
DOIT_CONFIG = {
'default_tasks': [
'check',
],
'continue': True,
'verbosity': 1,
'num_process': cores,
}
def task_flake8():
"""Run flake8 check."""
return {
'actions': ['flake8 setup.py pyppeteer tests'],
}
def task_mypy():
"""Run mypy check."""
return {
'actions': ['mypy pyppeteer'],
}
def task_pydocstyle():
"""Run docstyle check."""
return {
'actions': ['pydocstyle pyppeteer'],
}
def task_docs():
"""Build sphinx document."""
return {
'actions': [
'sphinx-build -q -W -E -j auto -b html docs docs/_build/html',
],
}
def task_readme():
"""Check long description for package."""
return {
'actions': ['python setup.py check -r -s'],
}
def task_spell():
"""Check spelling of comments and docstrings."""
return {
'actions': [
'pylint --disable all --enable spelling --spelling-dict en_US '
'--spelling-private-dict-file spell.txt pyppeteer'
],
}
def task_check():
"""Run flake8/mypy/pydocstyle/docs/readme tasks."""
return {
'actions': None,
'task_dep': ['flake8', 'mypy', 'pydocstyle', 'docs', 'readme']
}
def task_test():
"""Run pytest."""
return {
'actions': [CmdAction(
'pytest -n {}'.format(cores // 2),
buffering=1,
)],
'verbosity': 2,
}
def task_all():
"""Run all tests and checks."""
return {
'actions': None,
'task_dep': ['test', 'check'],
}