forked from life4/deal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
150 lines (142 loc) · 2.96 KB
/
Taskfile.yml
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# https://taskfile.dev/
version: "3"
vars:
PYTHON: python3
VENVS: .venvs
FLITENV: "{{.VENVS}}/base/bin/flitenv --venvs={{.VENVS}}"
env:
FLIT_ROOT_INSTALL: "1"
tasks:
install:base:
status:
- test -f {{.VENVS}}/base/bin/flitenv
cmds:
- "{{.PYTHON}} -m venv {{.VENVS}}/base"
- >
{{.VENVS}}/base/bin/python3 -m pip install flitenv
install:test:
sources:
- pyproject.toml
deps:
- install:base
cmds:
- >
{{.FLITENV}} test install
install:lint:
sources:
- pyproject.toml
deps:
- install:base
cmds:
- >
{{.FLITENV}} lint install
install:docs:
sources:
- pyproject.toml
deps:
- install:base
cmds:
- >
{{.FLITENV}} docs install
release:
cmds:
- grep -F {{.CLI_ARGS}} deal/__init__.py
- git add deal/__init__.py
- git commit -m "bump version"
- git tag {{.CLI_ARGS}}
- flit publish
- git push
- git push --tags
pytest:
desc: "run Python tests"
deps:
- install:test
cmds:
- "{{.FLITENV}} test run pytest {{.CLI_ARGS}}"
flake8:
desc: "lint Python code"
deps:
- install:lint
cmds:
- "{{.FLITENV}} lint run flake8 --ignore=DEL {{.CLI_ARGS}} ."
mypy:
desc: "check type annotations"
deps:
- install:lint
cmds:
- "{{.FLITENV}} lint run mypy {{.CLI_ARGS}}"
unify:
desc: "convert double quotes to single ones"
deps:
- install:lint
cmds:
- "{{.FLITENV}} lint run unify -r -i --quote=\\' {{.CLI_ARGS}} deal tests"
isort:
desc: "sort imports"
deps:
- install:lint
cmds:
- "{{.FLITENV}} lint run isort {{.CLI_ARGS}} ."
isort:check:
desc: "sort imports"
deps:
- install:lint
cmds:
- "{{.FLITENV}} lint run isort --check {{.CLI_ARGS}} ."
mypy_test:
desc: "validate type annotations"
deps:
- install:lint
cmds:
- "{{.FLITENV}} lint run mypy_test {{.CLI_ARGS}} ./types/"
sphinx:
desc: "generate documentation"
deps:
- install:docs
cmds:
- rm -rf docs/build
- "{{.FLITENV}} docs run sphinx-build -W docs docs/build {{.CLI_ARGS}}"
# groups
format:
desc: "run all code formatters"
cmds:
- task: isort
- task: unify
lint:
desc: "run all linters"
cmds:
- task: flake8
- task: mypy
- task: isort:check
test:
desc: "run all tests"
cmds:
- task: pytest
- task: mypy_test
all:
desc: "run all code formatters, linters, and tests"
cmds:
- task: format
- task: lint
- task: test
# aliases
pytest:run:
- task: pytest
database:run:
- task: database
flake8:run:
- task: flake8
mypy:run:
- task: mypy
mypy_test:run:
- task: mypy_test
isort:run:
- task: isort
yamllint:run:
- task: yamllint
bandit:run:
- task: bandit
linters:run:
- task: lint
services:run:
- task: services