ds-voidlinux-popcorn/justfile
2025-10-09 15:39:25 +02:00

43 lines
1.1 KiB
Makefile

default: versioned
clean: files kernels unique packages
test:
files:
python code/files.py input output
kernels:
python code/kernels.py input output
unique:
python code/unique.py input output
packages:
python code/packages.py input output
versioned:
#!/usr/bin/env bash
set -euxo pipefail
datalad get -r "input"
lastcommit=$(git log -1 --format=%H)
date=$(date +%F)
datalad run -m "Update dataset for ${date}" \
-o "input/*.json" -o "output/*.csv" \
just getraw clean validate
if [ "$lastcommit" != $(git log -1 --format=%H) ]; then
printf "\n## %s\n\n- auto generated\n" ${date} | sed -i '/CHANGELOG/r /dev/stdin' CHANGELOG.md
git add CHANGELOG.md && git commit -v --no-edit --amend
git tag -a "${date}" -m "Release ${date}"
fi
# requires python dev dependencies, thus to be running in venv
validate:
uv sync --dev --locked
uv run pytest
# requires python dependencies for http interactions
# 2018-05-09 is the first date of recording available
getraw:
uv sync --locked
uv run python code/get_raw.py --dir input --delay 1 2018-05-09