From dd42e6119cb70f011c1dd09c3b545edf35edd48d Mon Sep 17 00:00:00 2001 From: bronsen Date: Sun, 22 Feb 2026 12:17:34 +0100 Subject: [PATCH] just: congregate releated recipes; reuse recipes in "release" --- justfile | 49 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/justfile b/justfile index 4a5d23b..0c8c3d7 100644 --- a/justfile +++ b/justfile @@ -9,14 +9,6 @@ default: setup: uv sync -# builds a package -build: - uv build --wheel --clear - -# upload to Package Registry -upload: build - uv run twine upload --repository code.cbo --config-file ~/.config/pypirc dist/*.whl - # console to observe log messages console: uv run textual console @@ -29,16 +21,16 @@ run-console: run: uv run python -m {{ the_app }} -# export dependencies into requirements files -exports-deps: - uv export {{ uv_export_options }} --output-file requirements.txt - uv export {{ uv_export_options }} --output-file requirements.dev.txt --only-dev - # 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.txt + uv export {{ uv_export_options }} --output-file requirements.dev.txt --only-dev + # Run tests, ARGS are passed-through to pytest test *ARGS: uv run pytest tests.py -m "not final" {{ ARGS }} @@ -50,27 +42,18 @@ alltests *ARGS: coverage: uv run pytest tests.py --cov=src/ --cov-report term --cov-report xml --cov-report html --cov-config pyproject.toml -# run python and markdown +# lint python, markdown, wheel file names, prek config lint: uv run ruff check . markdownlint-cli2 . uv run twine check --strict dist/* + prek validate-config prek.toml -# pretend we are CI -ci: lint - prek run --all-files -# woodpecker-cli exec "whatever" - -[private] -bump segment: - uv version --bump {{ segment }} - -[private] -release segment *release_name: +release *release_name: #!/usr/bin/env fish - test -f releasenotes.md; and set -l body "$(cat releasenotes.md)"; or set -l body "" - set -l tag (uv version --short --output-format text --bump {{ segment }}) set -l release_name {{ release_name }} + test -f releasenotes.md; and set -l body "$(cat releasenotes.md)"; or set -l body "" + set -l tag (uv version --short --output-format text) git add pyproject.toml uv.lock git commit -m "Release version $tag" @@ -79,7 +62,15 @@ release segment *release_name: 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 + +# builds a package +build: uv build --wheel --clear - fj release create "v$tag: $release_name" --prerelease --tag "v$tag" --attach dist/*.whl --body "$body" - # uv run twine upload --config-file ~/.config/pypirc --repository code.cbo dist/*.whl +# upload to Package Registry +upload: + uv run twine upload --repository code.cbo --config-file ~/.config/pypirc dist/*.whl