-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTaskfile.yml
More file actions
87 lines (76 loc) · 1.89 KB
/
Taskfile.yml
File metadata and controls
87 lines (76 loc) · 1.89 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
version: '3'
includes:
uv: .task/taskfiles/Taskfile-python-uv.yml
misc: .task/taskfiles/Taskfile-misc.yml
vars:
WRAP: '{{ .ROOT_DIR }}/.task/taskfiles/utils/wrap'
ECHO_OK: '{{ .ROOT_DIR }}/.task/taskfiles/utils/echo_ok'
tasks:
clean:
desc: "Clean the repository"
silent: true
cmds:
- task: uv:clean
- rm -Rf apihtml html
mrproper:
desc: "Clean the repository (including downloaded tools)"
silent: true
deps:
- clean
cmds:
- task: uv:mrproper
install:
desc: "Install the venv"
silent: true
deps:
- uv:sync
lint:
desc: "Lint the code"
silent: true
cmds:
- task: uv:lint
- "{{.WRAP}} {{.UV}} run python .task/make-readme.py --lint"
- '{{.ECHO_OK}} "Linting OK"'
env:
STLOG_UNIT_TESTS_MODE: 1
test:
desc: "Test the code"
silent: true
cmds:
- task: uv:test
vars:
COVERAGE: 1
COVERAGE_PKG: "stlog"
- '{{.ECHO_OK}} "Tests OK"'
doc:
desc: "Generate documentation"
silent: true
deps:
- install
cmds:
- rm -Rf html apihtml
- "{{.WRAP}} {{.UV}} run mkdocs build --site-dir html"
- "{{.WRAP}} {{.UV}} run pdoc3 --html --output-dir=apihtml stlog"
- "{{.WRAP}} {{.UV}} run python .task/make-readme.py"
env:
STLOG_UNIT_TESTS_MODE: 1
no-dirty:
desc: "Check that the repository is clean"
silent: true
cmds:
- task: misc:no-dirty
- '{{.ECHO_OK}} "Repository is clean"'
publish:
desc: "Publish the package (to pypi)"
deps:
- install
cmds:
- "{{.WRAP}} {{.UV}} run python .task/taskfiles/utils/set-version.py stlog/__init__.py pyproject.toml"
- git diff
- |
if [ "${UV_PUBLISH_TOKEN:-}" = "" ]; then
echo "UV_PUBLISH_TOKEN is not set"
exit 1
fi
- task: uv:build
- task: uv:publish