-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
203 lines (199 loc) · 6.48 KB
/
Taskfile.yml
File metadata and controls
203 lines (199 loc) · 6.48 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
version: '1'
name: weekly
description: Minimal Taskfile
variables:
APP_NAME: weekly
environments:
local:
container_runtime: docker
compose_command: docker compose
pipeline:
python_version: "3.12"
runner_image: ubuntu-latest
branches: [main]
cache: [~/.cache/pip]
artifacts: [dist/]
stages:
- name: lint
tasks: [lint]
- name: test
tasks: [test]
- name: build
tasks: [build]
when: "branch:main"
tasks:
install:
desc: Install Python dependencies (editable)
cmds:
- pip install -e .[dev]
test:
desc: Run pytest suite
cmds:
- pytest -q
lint:
desc: Run ruff lint check
cmds:
- ruff check .
fmt:
desc: Auto-format with ruff
cmds:
- ruff format .
build:
desc: Build wheel + sdist
cmds:
- python -m build
clean:
desc: Remove build artefacts
cmds:
- rm -rf build/ dist/ *.egg-info
help:
desc: '[imported from Makefile] help'
cmds:
- echo ""
- echo "${YELLOW}Usage:${RESET} make ${GREEN}<target>${RESET}"
- echo ""
- echo "${YELLOW}Available targets:${RESET}"
- echo " ${GREEN}install${RESET} - Install package in development mode
with all dependencies"
- echo " ${GREEN}install-prod${RESET} - Install only production dependencies"
- echo " ${GREEN}test${RESET} - Run tests"
- echo " ${GREEN}test-cov${RESET} - Run tests with coverage report"
- echo " ${GREEN}lint${RESET} - Run all linters (black, isort, flake8)"
- echo " ${GREEN}format${RESET} - Format code"
- echo " ${GREEN}format-check${RESET} - Check code formatting"
- echo " ${GREEN}typecheck${RESET} - Run static type checking"
- echo " ${GREEN}check${RESET} - Run all checks (lint, format-check,
typecheck, test)"
- echo " ${GREEN}clean${RESET} - Remove build artifacts and cache"
- echo " ${GREEN}build${RESET} - Build package"
- echo " ${GREEN}publish${RESET} - Publish package to PyPI"
- echo " ${GREEN}docs${RESET} - Build documentation"
- echo " ${GREEN}serve${RESET} - Serve documentation locally"
- echo " ${GREEN}pre-commit${RESET} - Install pre-commit hooks"
- echo " ${GREEN}bump-version${RESET} - Bump version (make bump-version PART=patch)"
- echo " ${GREEN}safety${RESET} - Check for security vulnerabilities"
- echo " ${GREEN}dep-update${RESET} - Update dependencies"
- echo " ${GREEN}info${RESET} - Show package information"
- echo " ${GREEN}release${RESET} - Create a new release (tag and publish)"
- echo " ${GREEN}help${RESET} - Show this help message"
install-prod:
desc: '[imported from Makefile] install-prod'
cmds:
- echo "${YELLOW}Installing production dependencies...${RESET}"
- poetry install --only main
test-cov:
desc: '[imported from Makefile] test-cov'
cmds:
- echo "${YELLOW}Running tests with coverage...${RESET}"
- ${PYTEST} -v --cov=${PACKAGE} --cov-report=term-missing --cov-report=xml --cov-report=html
tests/
format:
desc: '[imported from Makefile] format'
cmds:
- echo "${YELLOW}Formatting code...${RESET}"
- ${BLACK} ${PACKAGE} tests/
- ${ISORT} ${PACKAGE} tests/
format-check:
desc: '[imported from Makefile] format-check'
cmds:
- echo "${YELLOW}Checking code formatting...${RESET}"
- ${BLACK} --check ${PACKAGE} tests/
- ${ISORT} --check-only ${PACKAGE} tests/
typecheck:
desc: '[imported from Makefile] typecheck'
cmds:
- echo "${YELLOW}Running type checking...${RESET}"
- ${MYPY} ${PACKAGE} tests/
check:
desc: '[imported from Makefile] check'
deps:
- lint
- format-check
- typecheck
- test
publish:
desc: '[imported from Makefile] publish'
cmds:
- '#@echo "${YELLOW}Publishing to PyPI...${RESET}"'
- poetry version patch
- poetry publish --build
docs:
desc: '[imported from Makefile] docs'
cmds:
- echo "${YELLOW}Building documentation...${RESET}"
- poetry run mkdocs build
serve:
desc: '[imported from Makefile] serve'
cmds:
- echo "${YELLOW}Serving documentation at http://localhost:8000${RESET}"
- poetry run mkdocs serve
pre-commit:
desc: '[imported from Makefile] pre-commit'
cmds:
- echo "${YELLOW}Installing pre-commit hooks...${RESET}"
- poetry run pre-commit install
bump-version:
desc: '[imported from Makefile] bump-version'
cmds:
- if [ -z "$(PART)" ]; then \
- 'echo "${YELLOW}Error: PART variable not set. Usage: make bump-version PART=<major|minor|patch>${RESET}";
\'
- exit 1; \
- fi
- echo "${YELLOW}Bumping $(PART) version...${RESET}"
- poetry version $(PART)
- git add pyproject.toml
- git commit -m "Bump version to $(shell poetry version -s)"
- git tag -a v$(shell poetry version -s) -m "Version $(shell poetry version -s)"
- echo "${GREEN}Version bumped to $(shell poetry version -s)${RESET}"
safety:
desc: '[imported from Makefile] safety'
cmds:
- echo "${YELLOW}Checking for security vulnerabilities...${RESET}"
- poetry run safety check --full-report
dep-update:
desc: '[imported from Makefile] dep-update'
cmds:
- echo "${YELLOW}Updating dependencies...${RESET}"
- poetry update
info:
desc: '[imported from Makefile] info'
cmds:
- echo "${YELLOW}Package Information:${RESET}"
- poetry version
- echo "\n${YELLOW}Dependencies:${RESET}"
- poetry show --tree
release:
desc: '[imported from Makefile] release'
cmds:
- echo "${YELLOW}Creating release...${RESET}"
- git push origin main --tags
- poetry publish --build
deps:
- check
- build
scan:
desc: '[imported from Makefile] scan'
cmds:
- echo "${YELLOW}Running weekly scan...${RESET}"
- poetry run weekly scan $(ROOT) -o $(OUT)
scan-since:
desc: '[imported from Makefile] scan-since'
cmds:
- echo "${YELLOW}Running weekly scan with since filter...${RESET}"
- poetry run weekly scan $(ROOT) -o $(OUT) --since "$(SINCE)"
health:
desc: '[from doql] workflow: health'
cmds:
- docker compose ps
- docker compose exec app echo "Health check passed"
import-makefile-hint:
desc: '[from doql] workflow: import-makefile-hint'
cmds:
- 'echo ''Run: taskfile import Makefile to import existing targets.'''
all:
desc: Run install, lint, test
cmds:
- taskfile run install
- taskfile run lint
- taskfile run test