just: congregate releated recipes; reuse recipes in "release"
This commit is contained in:
parent
84f488f06a
commit
dd42e6119c
1 changed files with 20 additions and 29 deletions
49
justfile
49
justfile
|
|
@ -9,14 +9,6 @@ default:
|
||||||
setup:
|
setup:
|
||||||
uv sync
|
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 to observe log messages
|
||||||
console:
|
console:
|
||||||
uv run textual console
|
uv run textual console
|
||||||
|
|
@ -29,16 +21,16 @@ run-console:
|
||||||
run:
|
run:
|
||||||
uv run python -m {{ the_app }}
|
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 dependencies to new versions
|
||||||
update-deps:
|
update-deps:
|
||||||
uv lock --upgrade
|
uv lock --upgrade
|
||||||
uv sync
|
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
|
# Run tests, ARGS are passed-through to pytest
|
||||||
test *ARGS:
|
test *ARGS:
|
||||||
uv run pytest tests.py -m "not final" {{ ARGS }}
|
uv run pytest tests.py -m "not final" {{ ARGS }}
|
||||||
|
|
@ -50,27 +42,18 @@ alltests *ARGS:
|
||||||
coverage:
|
coverage:
|
||||||
uv run pytest tests.py --cov=src/ --cov-report term --cov-report xml --cov-report html --cov-config pyproject.toml
|
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:
|
lint:
|
||||||
uv run ruff check .
|
uv run ruff check .
|
||||||
markdownlint-cli2 .
|
markdownlint-cli2 .
|
||||||
uv run twine check --strict dist/*
|
uv run twine check --strict dist/*
|
||||||
|
prek validate-config prek.toml
|
||||||
|
|
||||||
# pretend we are CI
|
release *release_name:
|
||||||
ci: lint
|
|
||||||
prek run --all-files
|
|
||||||
# woodpecker-cli exec "whatever"
|
|
||||||
|
|
||||||
[private]
|
|
||||||
bump segment:
|
|
||||||
uv version --bump {{ segment }}
|
|
||||||
|
|
||||||
[private]
|
|
||||||
release segment *release_name:
|
|
||||||
#!/usr/bin/env fish
|
#!/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 }}
|
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 add pyproject.toml uv.lock
|
||||||
git commit -m "Release version $tag"
|
git commit -m "Release version $tag"
|
||||||
|
|
@ -79,7 +62,15 @@ release segment *release_name:
|
||||||
git push
|
git push
|
||||||
git push origin tag "v$tag"
|
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
|
uv build --wheel --clear
|
||||||
|
|
||||||
fj release create "v$tag: $release_name" --prerelease --tag "v$tag" --attach dist/*.whl --body "$body"
|
# upload to Package Registry
|
||||||
# uv run twine upload --config-file ~/.config/pypirc --repository code.cbo dist/*.whl
|
upload:
|
||||||
|
uv run twine upload --repository code.cbo --config-file ~/.config/pypirc dist/*.whl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue