-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJustfile
executable file
·128 lines (108 loc) · 2.33 KB
/
Justfile
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import? '.just/changelog.just'
import? '.just/gh.just'
import? '.just/version.just'
# list available commands
default:
@just --list
#
# Develop
#
# run once on project creation
[group('develop')]
seed:
echo -e "#!/usr/bin/env bash\njust pre-commit" > .git/hooks/pre-commit
# initialize dev environment
[group('develop'), macos]
pre:
sudo port install gh git uv yq
# synchronize dev environment
[group('develop')]
sync:
chmod ug+x .git/hooks/*
uv sync --all-extras --all-groups --frozen
make requirements
# update dev environment
[group('develop')]
upgrade:
uv sync --all-extras --all-groups --upgrade
make requirements
copier update --trust --vcs-ref main
# run linters
[group('develop')]
lint:
uv run mypy .
uv run ruff check
uv run ruff format --diff
[private]
tox-provision:
time docker compose run --rm -it tox run --notest --skip-pkg-install
# run tests
[group('develop')]
test *toxargs: build
make tests/requirements.txt
rm -f .tox/*/.pass-*
{{ if toxargs == "" { "just tox-provision" } else { "" } }}
time docker compose run --rm -it tox \
{{ if toxargs == "" { "run-parallel" } else { "run" } }} \
--installpkg="$(find dist -name '*.whl')" {{toxargs}}
make badges
just docs
# enter testing docker container
[group('develop')]
shell:
docker compose run --rm -it --entrypoint bash tox
# build python package
[group('develop')]
build: sync
make build
# build docs
[group('develop')]
docs:
make docs
#
# Publish
#
# publish package on PyPI
[group('publish')]
pypi-publish: build
uv publish
#
# Manage
#
# display confirmation prompt
[private]
confirm msg:
@printf "\n{{msg}}, then press enter " && read
# run pre-commit hook
[group('manage')]
pre-commit:
just lint
just docs
# run pre-merge
[group('manage')]
pre-merge:
just lint
just docs
just test
# merge
[group('manage')]
merge:
just pre-merge
just gh-create-pr
just confirm "Merge pull request"
git switch main
git fetch
git pull
# release
[group('manage')]
release:
just pre-merge
just bump
just changelog
just docs
just confirm "Proofread the changelog and commit changes"
just merge
just gh-repo-upd
just gh-create-release
just confirm "Update release notes and publish GitHub release"
just pypi-publish