-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
120 lines (114 loc) · 2.53 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
# https://taskfile.dev/
version: "3"
vars:
PYTHON: python3
VENVS: .venvs
TEST_ENV: .venvs/test
LINT_ENV: .venvs/lint
TEST_PYTHON: "{{.TEST_ENV}}/bin/python3"
LINT_PYTHON: "{{.LINT_ENV}}/bin/python3"
env:
FLIT_ROOT_INSTALL: "1"
tasks:
install:flit:
status:
- which flit
cmds:
- python3 -m pip install flit
venv:test:
status:
- test -d {{.TEST_ENV}}
cmds:
- "{{.PYTHON}} -m venv {{.TEST_ENV}}"
venv:lint:
status:
- test -d {{.LINT_ENV}}
cmds:
- "{{.PYTHON}} -m venv {{.LINT_ENV}}"
install:test:
sources:
- pyproject.toml
deps:
- install:flit
- venv:test
cmds:
- >
flit install
--python {{.TEST_PYTHON}}
--extras=test,integrations
--deps=production
--symlink
install:lint:
sources:
- pyproject.toml
deps:
- install:flit
- venv:lint
cmds:
- >
flit install
--python {{.LINT_PYTHON}}
--extras=lint,integrations
--deps=production
--symlink
release:
desc: generate and upload a new release
deps:
- install:flit
cmds:
- which gh
- test {{.CLI_ARGS}}
- cat jockey/__init__.py | grep {{.CLI_ARGS}}
- rm -rf dist/
- flit build
- flit publish
- git tag {{.CLI_ARGS}}
- git push
- git push --tags
- gh release create --generate-notes {{.CLI_ARGS}}
- gh release upload {{.CLI_ARGS}} ./dist/*
pytest:
desc: "run Python tests"
cmds:
- task: install:test
- "{{.TEST_PYTHON}} -m pytest {{.CLI_ARGS}}"
ruff:
desc: "lint Python code"
cmds:
- task: install:lint
- "{{.LINT_PYTHON}} -m ruff check --preview {{.CLI_ARGS}} ."
ruff:fix:
desc: "fix all possible ruff violations"
cmds:
- task: install:lint
- "{{.LINT_PYTHON}} -m ruff check --preview --fix-only {{.CLI_ARGS}} ."
mypy:
desc: "check type annotations"
cmds:
- task: install:lint
- "{{.LINT_PYTHON}} -m mypy {{.CLI_ARGS}}"
yamllint:
desc: "lint YAML files"
cmds:
- task: install:lint
- "{{.LINT_PYTHON}} -m yamllint --strict {{.CLI_ARGS}} ."
# groups
format:
desc: "run all code formatters"
cmds:
- task: ruff:fix
lint:
desc: "run all linters"
cmds:
- task: ruff
- task: mypy
test:
desc: "run all tests"
cmds:
- task: pytest
all:
desc: "run all code formatters, linters, and tests"
cmds:
- task: format
- task: lint
- task: test