2026-04-12 03:55:28 +02:00
|
|
|
requirements_file_dev := "requirements.dev.txt"
|
|
|
|
|
pyproject := "pyproject.toml"
|
2026-02-22 19:35:22 +01:00
|
|
|
releasenotes := "releasenotes.md"
|
2026-02-22 19:44:29 +01:00
|
|
|
requirements_file := "requirements.txt"
|
2026-04-12 03:55:28 +02:00
|
|
|
the_app := "teilchensammler_cli.main"
|
|
|
|
|
uv_export_options := "--frozen --format requirements.txt --quiet --no-install-project"
|
2026-02-19 21:14:19 +01:00
|
|
|
|
2026-04-20 19:35:29 +02:00
|
|
|
uv := require("uv")
|
|
|
|
|
git := require("git")
|
|
|
|
|
fj := require("fj")
|
|
|
|
|
prek := require("prek")
|
|
|
|
|
markdownlint := require("markdownlint-cli2")
|
|
|
|
|
mv := require("mv")
|
|
|
|
|
|
2026-02-15 17:39:44 +01:00
|
|
|
[private]
|
2025-12-09 21:24:55 +01:00
|
|
|
default:
|
|
|
|
|
@just --list
|
|
|
|
|
|
2026-02-15 17:39:44 +01:00
|
|
|
# create venv, install dependencies
|
2025-12-09 21:26:27 +01:00
|
|
|
setup:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} sync
|
2025-12-09 21:26:27 +01:00
|
|
|
|
2026-02-15 17:39:44 +01:00
|
|
|
# console to observe log messages
|
2025-12-09 21:25:44 +01:00
|
|
|
console:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run textual console
|
2025-12-09 21:25:44 +01:00
|
|
|
|
|
|
|
|
# run app with logs going to console
|
2026-02-19 21:02:02 +01:00
|
|
|
run-console:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run textual run --dev {{ the_app }}
|
2025-12-09 21:25:44 +01:00
|
|
|
|
2026-02-15 17:39:44 +01:00
|
|
|
# run the app
|
2025-12-26 18:16:07 +01:00
|
|
|
run:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run python -m {{ the_app }}
|
2025-12-26 18:16:07 +01:00
|
|
|
|
2026-02-15 17:39:44 +01:00
|
|
|
# Update dependencies to new versions
|
2026-02-14 23:17:36 +01:00
|
|
|
update-deps:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} lock --upgrade
|
|
|
|
|
{{ uv }} sync
|
2026-02-14 23:17:36 +01:00
|
|
|
|
2026-02-22 12:17:34 +01:00
|
|
|
# export dependencies into requirements files
|
|
|
|
|
exports-deps:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} export {{ uv_export_options }} --output-file {{ requirements_file }}
|
|
|
|
|
{{ uv }} export {{ uv_export_options }} --output-file {{ requirements_file_dev }} --only-dev
|
2026-02-22 12:17:34 +01:00
|
|
|
|
2026-02-19 21:15:18 +01:00
|
|
|
# Run tests, ARGS are passed-through to pytest
|
2026-02-14 18:56:30 +01:00
|
|
|
test *ARGS:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run pytest tests.py -m "not final" {{ ARGS }}
|
2026-02-20 21:26:34 +01:00
|
|
|
|
|
|
|
|
alltests *ARGS:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run pytest tests.py {{ ARGS }}
|
2025-12-09 21:24:08 +01:00
|
|
|
|
2026-02-15 17:39:44 +01:00
|
|
|
# run tests and create coverage reports
|
2025-12-09 21:24:08 +01:00
|
|
|
coverage:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run pytest tests.py -m "not final" --cov=src/ --cov-report term --cov-report xml --cov-report html --cov-config {{ pyproject }}
|
2025-12-09 21:24:08 +01:00
|
|
|
|
2026-02-22 12:17:34 +01:00
|
|
|
# lint python, markdown, wheel file names, prek config
|
2026-02-19 21:14:46 +01:00
|
|
|
lint:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run ruff check .
|
|
|
|
|
{{ markdownlint }} .
|
|
|
|
|
{{ uv }} run twine check --strict dist/*
|
|
|
|
|
{{ prek }} validate-config prek.toml
|
2025-12-05 17:07:19 +01:00
|
|
|
|
2026-04-20 19:35:29 +02:00
|
|
|
release *release_name: setup
|
2026-02-22 11:15:25 +01:00
|
|
|
#!/usr/bin/env fish
|
2026-02-22 19:35:22 +01:00
|
|
|
test -f {{ releasenotes }}; and set -l body "$(cat {{ releasenotes }})"; or begin echo Release notes are missing!; exit 2; end
|
2026-02-22 12:17:34 +01:00
|
|
|
set -l tag (uv version --short --output-format text)
|
2026-02-21 13:28:05 +01:00
|
|
|
|
2026-02-22 19:44:29 +01:00
|
|
|
just exports-deps
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ git }} add {{ pyproject }} uv.lock {{ requirements_file }} {{ requirements_file_dev }}
|
|
|
|
|
{{ git }} commit -m "Release version $tag"
|
|
|
|
|
{{ git }} tag "v$tag"
|
2026-02-21 13:28:05 +01:00
|
|
|
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ git }} push
|
|
|
|
|
{{ git }} push origin tag "v$tag"
|
2026-02-21 13:28:05 +01:00
|
|
|
|
2026-02-22 12:17:34 +01:00
|
|
|
just build
|
|
|
|
|
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ fj }} release create "v$tag: {{ release_name }}" --tag "v$tag" --attach dist/*.whl --body "$body"
|
2026-02-22 19:44:29 +01:00
|
|
|
just upload
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ mv }} {{ releasenotes }} {{ releasenotes }}.$tag
|
2026-02-22 12:17:34 +01:00
|
|
|
|
|
|
|
|
# builds a package
|
|
|
|
|
build:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} build --wheel --clear
|
2026-02-21 13:28:05 +01:00
|
|
|
|
2026-02-22 12:17:34 +01:00
|
|
|
# upload to Package Registry
|
|
|
|
|
upload:
|
2026-04-20 19:37:43 +02:00
|
|
|
{{ uv }} run twine upload --repository code.cbo --config-file ~/.config/pypirc dist/*.whl
|