-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (39 loc) · 1.1 KB
/
Makefile
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
# usage:
# make release tag=1.0.0
#In case a tag has been pushed to GitHub, but the release failed, run `
# git tag --delete v1.0.0
# git push --delete origin v1.0.0
# and repeat the steps below
install:
rm -rf .venv
python -m venv .venv
.venv/bin/pip install -e ".[dev]"
lint:
mypy --check-untyped-defs --ignore-missing-imports .
ruff check --fix .
format:
ruff format .
test:
bash tests/tests.sh
toc:
find * -type f ! -name 'CHANGELOG.md' -exec toc -f {} \;
review:
git status
echo "Abort now if there are files that needs to be committed"
sleep 10
tag_bump:
grep -q $(tag) pyproject.toml || sed -i pyproject.toml -e "s|version = .*|version = \"$(tag)\"|"
tag_changelog:
git tag v$(tag) -m v$(tag)
# enter "v1.0.0"
git-cliff -c pyproject.toml > CHANGELOG.md
tag_commit_new_changelog:
git tag --delete v$(tag)
git add pyproject.toml || true
git add CHANGELOG.md || true
git commit -m "minor: updated CHANGELOG.md" || true
git tag -fa v$(tag) -m v$(tag)
tag_publish::
git push --follow-tags
tag: tag_bump tag_changelog tag_commit_new_changelog tag_publish
release: lint format test toc review tag