-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
96 lines (78 loc) · 2.15 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
version: '3'
env:
COMPOSE_FILE: .dev/compose.yaml
tasks:
# dev environment
dev:
desc: Enter dev container.
cmds:
- task: dev:build
- docker compose run --service-ports --rm dev
dev:build:
internal: true
cmds:
- docker compose build
# dev commands
install:
desc: Install package system-wide.
cmds:
- uv pip install --system -e .
build:
desc: Build artefacts
cmds:
- task: build:classification
- rm -rf dist
- mv README.md README.md.backup
- sed -e'{/#gh-dark-mode-only/ d; s|(docs/\(img/.*\)#gh-light-mode-only|(https://caseutil.readthedocs.io/en/latest/\1|;}'
README.md.backup > README.md
- uv build
- rm README.md
- mv README.md.backup README.md
build:classification:
internal: true
sources: [docs/classification.md]
generates:
- docs/img/classification-dark.svg
- docs/img/classification-light.svg
cmds:
- sed -ne '/^```mermaid/,/^```/{/^```mermaid/d; s/^```//; p;}' docs/classification.md > /tmp/classification.mmd
- mmdc -p /root/puppeteer-config.json -i /tmp/classification.mmd -o docs/img/classification-dark.svg -t dark -b transparent 2>/dev/null
- mmdc -p /root/puppeteer-config.json -i /tmp/classification.mmd -o docs/img/classification-light.svg -t default -b transparent 2>/dev/null
docs:
desc: Serve local MkDocs.
cmds:
- mkdocs serve
lint:
desc: Run linters.
cmds:
- ruff check
- ruff format --check
format:
desc: Run code formatters.
cmds:
- ruff format
version:
desc: Bump project version. Use task version -- patch|minor|major|...
cmds:
- bump-my-version bump {{.CLI_ARGS}}
release:
desc: Publish package on PyPI.
preconditions:
- test $(git rev-parse --abbrev-ref HEAD) = main
cmds:
- task: build
- uv publish
# dev testing
test:
desc: Run tests.
cmds:
- tox run
test:main:
desc: Run tests in main environment.
cmds:
- tox run -m main
test:debug:
desc: Run tests and open debugger on errors.
deps: [install]
cmds:
- pytest --pdb {{.CLI_ARGS}}