-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
87 lines (59 loc) · 1.78 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
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
TARGET=busylight
PYPROJECT= pyproject.toml
.PHONY: docs/busylight.1.md \
docs/busyserve.1.md \
docs \
MAJOR MINOR PATCH \
major minor patch \
push publish\
patch_release minor_release major_release \
release clean
all:
@echo "major_release - push and publish a major release"
@echo "minor_release - push and publish a minor release"
@echo "patch_release - push and publish a patch release"
@echo "push - pushes commits and tags to origin/master"
@echo "publish - publish package to PyPI"
@echo "report - generate a code coverage report"
@echo "mypy - type check the code base"
major: MAJOR update
minor: MINOR update
patch: PATCH update
MAJOR:
@poetry version major
MINOR:
@poetry version minor
PATCH:
@poetry version patch
docs: docs/busylight.1.md docs/busyserve.1.md
docs/busylight.1.md:
@typer $(TARGET).__main__ utils docs --name busylight --output $@
@sed -i '' -e "s///g" $@
docs/busyserve.1.md:
@typer --app webapi $(TARGET).__main__ utils docs --name busyserve --output $@
@sed -i '' -e "s///g" $@
update:
@git add $(PYPROJECT)
@awk '/^version =/ {print $$3}' $(PYPROJECT) | xargs git commit -m
@awk '/^version =/{print $$3}' $(PYPROJECT) | xargs git tag
push:
@git push --tags origin master
publish:
@poetry build
@poetry publish
requirements.txt: poetry.lock
@poetry export -o $@
@git add $@
@git commit -m "export requirements from poetry for dependabot"
major_release: major push publish
minor_release: minor push publish
patch_release: patch push publish
release: patch_release
report:
pytest --cov=./busylight --cov-report=html
open htmlcov/index.html
mypy: MYPY= mypy
mypy:
$(MYPY) --config-file $(PYPROJECT) $(TARGET)
clean:
@rm -rf dist $(TARGET).egg-info *.log htmlcov