Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
129 lines (121 loc) · 3.81 KB
/
Copy pathTaskfile.yml
File metadata and controls
129 lines (121 loc) · 3.81 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
version: '3'
dotenv: ['.env']
tasks:
##############################
### TESTS
##############################
test:
cmds:
- uv run pytest {{.CLI_ARGS}}
desc: Run pytest
aliases: [t]
test:watch:
cmds:
# ptw crashes without this fix, ] must be indented
- sed -i '' 's/^]$/ ]/' pyproject.toml
- uv run ptw -- {{.CLI_ARGS}}
desc: Run pytest-watch
aliases: [tw]
test:coverage:
cmds:
- uv run pytest {{.CLI_ARGS}} --cov --cov-report=lcov:lcov.info --cov-report=term:skip-covered
desc: Run pytest with coverage reporting
aliases: [tc]
test:watch-coverage:
cmds:
# ptw crashes without this fix, ] must be indented
- sed -i '' 's/^]$/ ]/' pyproject.toml
- uv run ptw -- {{.CLI_ARGS}} --cov --cov-report=lcov:lcov.info --cov-report=term:skip-covered
desc: Run pytest-watch with coverage reporting
aliases: [twc, tcw]
##############################
### LINT
##############################
lint:
cmds:
- bash -c "$(curl -fsSL https://gist.githubusercontent.com/Elijas/ce4480d070d4726fe7eb1863d1afd58d/raw/657b0bfea2b660ee3b0938c79f53418a03229cf3/init_generator.sh)"
- uv run ruff check --fix
desc: Run Ruff linter in watch mode with auto-fix
aliases: [l]
lint-watch:
cmds:
- uv run ruff check --fix --watch
desc: Run Ruff linter in watch mode with auto-fix
aliases: [lw]
upgrade-dependencies:
desc: Upgrade all project dependencies to their latest compatible versions
cmds:
- uv sync --upgrade
- baml_agents/devtools/_update_baml_generator_versions.py --search-root-path "{{ .TASKFILE_DIR }}" --target-version "$(uv pip list | grep baml-py | awk '{print $2}')" --verbose false
aliases: [ud]
generate-commit-message:
desc: Generate a commit message
cmds:
- task: upgrade-dependencies
- task: lint
- git add -A
- uv run generate-commit-message --model gpt-4o
aliases: [gcm]
##############################
### PUBLISH
##############################
ensure-clean-working-tree: # Ensure no changes in the working tree or index, abort if any.
silent: true
internal: true
cmds:
- if git diff --exit-code > /dev/null 2>&1 && git diff --cached --exit-code > /dev/null 2>&1; then :; else echo "Changes detected in the working tree or index. Please commit or stash them before proceeding."; exit 1; fi
bump:internal:
internal: true
cmds:
- uv run devtools/bump_readme_version.py `bump-my-version show --increment {{.type}} new_version`
- git add README.md
- uv run bump-my-version bump {{.type}}
desc: Bump version in README.md and pyproject.toml (internal)
bump:patch:
cmds:
- task: bump:internal
vars:
type: patch
desc: Bump patch version [Usage] bp
aliases: [bp]
bump:minor:
cmds:
- task: bump:internal
vars:
type: minor
desc: Bump minor version [Usage] bm
aliases: [bm]
publish:internal:
internal: true
cmds:
# Check git state
- task: ensure-clean-working-tree
- git pull
# Check code state
- uv run pytest -q
- task lint
# Bump version
- task: bump:internal
vars:
type: '{{.type}}'
# Upload to PyPI
- rm -rf dist
- uv build
- uv publish
# Upload to Github, uploading to Github after PyPI allows for the shields.io badge to be cached to the accurate pypi version
- git push
desc: Base publish task (internal)
publish:patch:
cmds:
- task: publish:internal
vars:
type: patch
desc: Publish patch version update [Usage] pp
aliases: [pp]
publish:minor:
cmds:
- task: publish:internal
vars:
type: minor
desc: Publish minor version update [Usage] pm
aliases: [pm]