teilchensammler-cli/justfile

91 lines
2.4 KiB
Makefile
Raw Permalink Normal View History

2026-04-12 03:55:28 +02:00
requirements_file_dev := "requirements.dev.txt"
pyproject := "pyproject.toml"
releasenotes := "releasenotes.md"
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"
uv := require("uv")
git := require("git")
fj := require("fj")
prek := require("prek")
markdownlint := require("markdownlint-cli2")
mv := require("mv")
woodpecker-cli := require("woodpecker-cli")
2026-02-15 17:39:44 +01:00
[private]
default:
@just --list
2026-02-15 17:39:44 +01:00
# create venv, install dependencies
setup:
uv sync
2026-02-15 17:39:44 +01:00
# console to observe log messages
console:
uv run textual console
# run app with logs going to console
2026-02-19 21:02:02 +01:00
run-console:
uv run textual run --dev {{ the_app }}
2026-02-15 17:39:44 +01:00
# run the app
run:
uv run python -m {{ the_app }}
2026-02-15 17:39:44 +01:00
# Update dependencies to new versions
update-deps:
uv lock --upgrade
uv sync
# export dependencies into requirements files
exports-deps:
uv export {{ uv_export_options }} --output-file {{ requirements_file }}
uv export {{ uv_export_options }} --output-file {{ requirements_file_dev }} --only-dev
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:
uv run pytest -m "not final" {{ ARGS }}
testall *ARGS:
uv run pytest {{ 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:
uv run pytest -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
# lint python, markdown, wheel file names, prek config
2026-02-19 21:14:46 +01:00
lint:
uv run ruff check .
markdownlint-cli2 .
uv run twine check --strict dist/*
prek validate-config prek.toml
woodpecker-cli lint .woodpecker/workflow.yaml
release *release_name: setup
#!/usr/bin/env fish
test -f {{ releasenotes }}; and set -l body "$(cat {{ releasenotes }})"; or begin echo Release notes are missing!; exit 2; end
set -l tag (uv version --short --output-format text)
just exports-deps
git add {{ pyproject }} uv.lock {{ requirements_file }} {{ requirements_file_dev }}
git commit -m "Release version $tag"
git tag "v$tag"
git push
git push origin tag "v$tag"
just build
fj release create "v$tag: {{ release_name }}" --tag "v$tag" --attach dist/*.whl --body "$body"
just upload
mv {{ releasenotes }} {{ releasenotes }}.$tag
# builds a package
build:
uv build --wheel --clear
# upload to Package Registry
upload:
uv run twine upload --repository code.cbo --config-file ~/.config/pypirc dist/*.whl