-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
68 lines (46 loc) · 1.3 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
TARGET=bitvector
VERSION_FILE= $(TARGET)/__version__.py
PYPROJECT= pyproject.toml
.PHONY: $(VERSION_FILE) README.md \
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"
coverage:
pytest --cov-report=html --cov=$(TARGET) tests
major: MAJOR update
minor: MINOR update
patch: PATCH update
MAJOR:
@poetry version major
MINOR:
@poetry version minor
PATCH:
@poetry version patch
update: $(VERSION_FILE)
@git add $(PYPROJECT) $(VERSION_FILE)
@awk '{print $$3}' $(VERSION_FILE) | xargs git commit -m
@awk '{print $$3}' $(VERSION_FILE) | xargs git tag
$(VERSION_FILE):
@awk '/^version/ {print $$0}' $(PYPROJECT) | sed "s/version/__version__/" > $@
push:
@git push --tags origin master
publish:
@poetry build
@poetry publish
patch_release: patch push publish
major_release: major push publish
minor_release: minor push publish
release: patch_release
mypy: MYPY= mypy
mypy:
$(MYPY) $(TARGET)
clean:
@rm -rf htmlcov