-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTaskfile.yml
125 lines (107 loc) · 2.47 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
# https://taskfile.dev
version: '3'
includes:
docker: containers/Taskfile.yml
tasks:
default:
cmds:
- task -l
silent: true
check:
desc: Run all 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
- poetry install
sources:
- poetry.lock
- pyproject.toml
generates:
- poetry.lock
method: checksum
dependency-install-ci:
cmds:
- poetry install
sources:
- poetry.lock
- pyproject.toml
generates:
- poetry.lock
method: checksum
setup:
desc: Bootstrap dev environment
preconditions:
- sh: "[ $(python3 --version | cut -d ' ' -f 2 | awk -F'.' '{print ($2 >= 11) }') = 1 ]"
msg: "Required python version not found (>=3.11)"
cmds:
- task: pre-commit-setup
- task: poetry-setup
- task: virtualenv
- task: pre-commit
- task: dependency-install
setup-ci:
preconditions:
- sh: "[ $(python3 --version | cut -d ' ' -f 2 | awk -F'.' '{print ($2 >= 8) }') = 1 ]"
msg: "Required python version not found (>=3.8)"
cmds:
- task: pre-commit-setup
- task: poetry-setup
- task: virtualenv
- task: pre-commit
- task: dependency-install-ci
test:
desc: Run python test and coverage
cmds:
- pytest --cov=pdh .
build:
desc: "Build python wheel"
cmds:
- poetry build
publish:
desc: "Publish wheel to pypi"
cmds:
- poetry publish -u $PYPI_USERNAME -p $PYPI_TOKEN
deps:
- build
clean:
desc: Cleanup
cmds:
- rm -rf ./dist
reset:
desc: Reset dev environment
cmds:
- rm -rf .venv .task
nix:build:
desc: Build nix derivation
cmds:
- nix build --json | jq -r '.[].outputs | to_entries[].value' | cachix push pdh
- nix flake archive --json | jq --raw-output '.path, (.inputs | to_entries [] .value.path)' | cachix push pdh