1818 VERSION :
1919 sh : " {{ '{{.RUN_SCRIPT}}' }} python -c \" import sys; sys.path.insert(0, 'src'); from {{ '{{.PROJECT_SLUG}}' }} import __version__; print(__version__)\" "
2020 LOCAL_PLATFORM :
21- sh : " bash {{ '{{.SCRIPTS_DIR}}' }}/get_platform.sh "
21+ sh : " {{ '{{.RUN_SCRIPT}}' }} {{ '{{.SCRIPTS_DIR}}' }}/get_platform.py "
2222 # Use PLATFORM if specified, otherwise use LOCAL_PLATFORM
2323 PLATFORM : ' {{ ' {{if .PLATFORM}}' }}{{ '{{.PLATFORM}}' }}{{ '{{else}}' }}{{ '{{.LOCAL_PLATFORM}}' }}{{ '{{end}}' }}'
2424 # Output redirect based on CI environment
3434 - pyproject.toml
3535 - uv.lock
3636 preconditions :
37- - which uv
37+ - uv --version
3838 cmds :
3939 # Sync dependencies with uv
4040 - uv sync --frozen --all-extras
4747 status :
4848 # Don't do any of this if you aren't in a git repository; quote to avoid yaml intrepretering the ! as a node tag
4949 # https://yaml.org/spec/1.2.2/#691-node-tags
50- - ' ! test -d . git'
50+ - ' ! git rev-parse -- git-dir '
5151 cmds :
5252 - uv tool install pre-commit
5353 # Don't run this in pipelines
8888 TIMESTAMP :
8989 sh : ' {{ ' {{.RUN_SCRIPT}}' }} {{ '{{.SCRIPTS_DIR}}' }}/get_rfc3339_timestamp.py'
9090 EPOCH :
91- sh : ' bash {{ ' {{.SCRIPTS_DIR}}' }}/get_epoch.sh '
91+ sh : ' {{ ' {{.RUN_SCRIPT}}' }} {{ '{{.SCRIPTS_DIR}}' }}/get_epoch.py '
9292 COMMIT_HASH :
9393 sh : git rev-parse HEAD
9494 BUILD_PLATFORM : ' {{ ' {{if eq .PLATFORM "all"}}' }}{{ '{{.SUPPORTED_PLATFORMS}}' }}{{ '{{else if .PLATFORM}}' }}{{ '{{.PLATFORM}}' }}{{ '{{else}}' }}{{ '{{.LOCAL_PLATFORM}}' }}{{ '{{end}}' }}'
@@ -173,8 +173,8 @@ tasks:
173173 update :
174174 desc : Update the project dev and runtime dependencies
175175 cmds :
176- # Upgrade uv via brew on macOS/Linux when running locally (not CI)
177- - ' {{ ' {{if and ( ne .GITHUB_ACTIONS "true") ( ne OS "windows") }}' }}brew upgrade uv{{ '{{end}}' }}'
176+ # Upgrade uv when running locally (not CI); use brew on macOS/Linux, uv self update on Windows
177+ - ' {{ ' {{if ne .GITHUB_ACTIONS "true"}}{{if ne OS "windows"}}' }}brew upgrade uv{{ '{{else}}' }}uv self update{{ '{{end}} {{end}}' }}'
178178 - uv tool upgrade --all
179179 - pre-commit autoupdate --freeze --jobs 4
180180 - uv lock --upgrade
@@ -187,27 +187,16 @@ tasks:
187187 clean :
188188 desc : Clean up build artifacts, cache files/directories, temp files, etc.
189189 cmds :
190- - rm -rf .pytest_cache
191- - rm -rf htmlcov
192- - rm -rf .coverage
193- - rm -rf dist
194- - rm -rf build
195- - rm -rf *.egg-info
196- - rm -f sbom.*.json
197- - rm -f vulns.*.json
198- - rm -f license-check.*.json
199- - rm -f {{ cookiecutter.github_org }}_{{ cookiecutter.project_slug }}_*_*.tar
200- - find . -type d -name __pycache__ -exec rm -rf {} + || true
201- - find . -type f -name '*.pyc' -delete || true
190+ - ' {{ ' {{.RUN_SCRIPT}}' }} {{ '{{.SCRIPTS_DIR}}' }}/clean.py'
202191
203192 release :
204193 desc : Cut a project release
205194 env :
206195 GH_TOKEN :
207196 sh : |
208- if [[ -n "${GH_TOKEN:-}" ] ]; then
197+ if [ -n "${GH_TOKEN:-}" ]; then
209198 echo "${GH_TOKEN}"
210- elif command -v gh &> /dev/null && gh auth token & > /dev/null; then
199+ elif gh auth token > /dev/null 2>&1 ; then
211200 gh auth token
212201 fi
213202 cmds :
0 commit comments