-
Notifications
You must be signed in to change notification settings - Fork 1
/
mold.yaml
107 lines (96 loc) · 3.37 KB
/
mold.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: "0.5"
includes:
- url: "github.com/xtfc/std.mold"
ref: "0.5"
recipes:
lint:
help: "Lint using flake8"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
FLAKE_ARGS: "Additional arguments to pass to flake8"
PYDIRS: "Directories containing Python files"
script: |
$PYRUN flake8 $FLAKE_ARGS $PYDIRS
fmt:
help: "Autoformat using black"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
BLACK_ARGS: "Additional arguments to pass to black"
PYDIRS: "Directories containing Python files"
script: |
$PYRUN black $BLACK_ARGS $PYDIRS
fmtcheck:
help: "Lint using black"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
BLACK_ARGS: "Additional arguments to pass to black"
PYDIRS: "Directories containing Python files"
script: |
$PYRUN black --check $BLACK_ARGS $PYDIRS
docstubs:
help: "Generate doc stubs using sphinx-apidoc"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
APIDOC_ARGS: "Additional arguments to pass to sphinx-apidoc"
DOCSDIR: "Directory containing documentation files; default `docs`"
PYMOD: "Primary Python module to document"
script: |
$PYRUN sphinx-apidoc -fM -o ${DOCSDIR:-docs} -a ${PYMOD} $APIDOC_ARGS
docs:
help: "Generate docs using sphinx-build"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
APIDOC_ARGS: "Additional arguments to pass to sphinx-apidoc"
DOCSDIR: "Directory containing documentation files; default `docs`"
DOCSOUTPUT: "Directory to output documentation; default `docs_build`"
DOCSFMT: "Format to build documentation; default `html`"
PYMOD: "Primary Python module to document"
script: |
$PYRUN sphinx-build -b ${DOCSFMT:-html} ${DOCSDIR:-docs} -a ${DOCSOUTPUT:-docs_build}
test:
help: "Run tests using pytest"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
PYTEST_ARGS: "Additional arguments to pass to pytest"
script: |
$PYRUN pytest $PYTEST_ARGS
coverage:
help: "Run tests using pytest and collect coverage data"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
PYMOD: "Primary Python module to document"
script: |
$PYRUN coverage run --source=$PYMOD -m pytest
$PYRUN coverage report
$PYRUN coverage html
clean:
help: "Remove build artifacts"
runtime: "sh"
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
script: |
$PYRUN rm -rf build/ dist/ *.egg-info/
package:
help: "Create a package for publishing"
runtime: "sh"
deps: ["clean"]
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
script: |
$PYRUN python setup.py sdist bdist_wheel
publish:
help: "Publish to a package index"
runtime: "sh"
deps: ["package"]
variables:
PYRUN: "Optional prefix to activate an environment, eg: `poetry run`"
PYPI: "PyPI repository URL"
script: |
$PYRUN twine upload --repository-url $PYPI dist/*