-
Notifications
You must be signed in to change notification settings - Fork 4
/
Taskfile.yml
80 lines (68 loc) · 1.44 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
# https://taskfile.dev
version: '3'
tasks:
default:
cmds:
- task -l
silent: true
check:
desc: "Run pre-commit hooks"
cmds:
- pre-commit run -a
virtualenv:
cmds:
- python3 -m venv .venv
sources:
- .venv/bin/activate
generates:
- .venv/bin/activate
method: checksum
pre-commit:
cmds:
- pre-commit install
sources:
- .git/hooks/pre-commit
- .pre-commit-config.yaml
generates:
- .git/hooks/pre-commit
method: checksum
pre-commit-setup:
cmds:
- pip3 install pre-commit
status:
- which pre-commit
poetry-setup:
cmds:
- pip3 install poetry
status:
- which poetry
dependency-install:
cmds:
- source .venv/bin/activate
- pip3 install -r requirements.txt
sources:
- requirements.txt
method: checksum
setup:
desc: Bootstrap dev environment
preconditions:
- sh: "[ $(python3 --version | cut -d ' ' -f 2 | awk -F'.' '{print ($2 > 6) }') = 1 ]"
msg: "Required python version not found (>=3.6)"
cmds:
- task: pre-commit-setup
- task: virtualenv
- task: pre-commit
- task: dependency-install
test:
desc: Run tests
cmds:
- task: setup
- source .venv/bin/activate && pytest -v .
clean:
desc: Cleanup
cmds:
- rm -rf ./dist
reset:
desc: Reset dev environment
cmds:
- rm -rf .venv .task