-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
81 lines (67 loc) · 2.27 KB
/
Copy pathjustfile
File metadata and controls
81 lines (67 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
project := "clone_repo"
default: pre-commit lint coverage
test: pytest
# Run pytest
pytest *ARGS="-vv":
poetry run pytest {{ARGS}}
# Run pytest with coverage
coverage *ARGS=("-vv --cov=" + project + " --cov-report=html --cov-report=term --cov-branch --cov-context=test"):
poetry run pytest {{ARGS}}
# Run all linting actions
lint: ruff mypy black
# Lint code with ruff
ruff COMMAND="check" *ARGS=".":
poetry run ruff {{COMMAND}} {{ARGS}}
# Check code with Mypy
mypy *ARGS=".":
poetry run mypy {{ARGS}}
# Check files with black
black *ARGS=".":
poetry run black {{ARGS}}
# Run pre-commit
pre-commit COMMAND="run" *ARGS="--all-files":
poetry run pre-commit {{COMMAND}} {{ARGS}}
# Add a CHANGELOG.md entry, e.g. just changelog-add added "My entry"
changelog-add TYPE ENTRY:
poetry run changelog-manager add {{TYPE}} "{{ENTRY}}"
# Install and bootstrap your dev env, usually a one off
bootstrap-dev-env:
asdf install
poetry install
poetry run pre-commit install
# Find out what your next released version might be based on the changelog.
next-version:
poetry run changelog-manager suggest
# Build and create files for a release
prepare-release:
#!/bin/bash
set -xeuo pipefail
poetry run changelog-manager release
poetry version $(poetry run changelog-manager current)
rm -rvf dist
poetry build
# Tag and release files, make sure you run 'just prepare-release' first.
do-release:
#!/bin/bash
set -xeuo pipefail
VERSION=$(poetry run changelog-manager current)
POETRY_VERSION=$(poetry version -s)
if [ "${VERSION}" != "${POETRY_VERSION}" ]; then
echo "Mismatch between changelog version ${VERSION} and poetry version ${VERSION}"
exit 1
fi
git add pyproject.toml CHANGELOG.md
mkdir -p build
poetry run changelog-manager display --version $VERSION > build/release-notes.md
if [ ! -f dist/{{project}}-${VERSION}.tar.gz ]; then
echo "Missing expected file in dist, did you run 'just prepare-release'?"
exit 1
fi
poetry publish --dry-run
git commit -m"Release ${VERSION}"
git tag $VERSION
git push origin $VERSION
git push origin main
gh release create $VERSION --title $VERSION -F build/release-notes.md ./dist/*
poetry publish
rm -rvf ./dist