-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
66 lines (52 loc) · 1.34 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
PROJECT_NAME=amqp_mock
.PHONY: install
install:
pip3 install --quiet --upgrade pip
pip3 install --quiet -r requirements.txt -r requirements-dev.txt
.PHONY: build
build:
pip3 install --quiet --upgrade pip
pip3 install --quiet --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
.PHONY: publish
publish:
twine upload dist/*
.PHONY: test
test:
python3 -m pytest -s
.PHONY: coverage
coverage:
python3 -m pytest --cov --cov-report=term --cov-report=xml:$(or $(COV_REPORT_DEST),coverage.xml)
.PHONY: check-types
check-types:
python3 -m mypy ${PROJECT_NAME} --strict
.PHONY: check-imports
check-imports:
python3 -m isort ${PROJECT_NAME} tests --check-only
.PHONY: sort-imports
sort-imports:
python3 -m isort ${PROJECT_NAME} tests
.PHONY: check-style
check-style:
python3 -m flake8 ${PROJECT_NAME} tests
.PHONY: lint
lint: check-types check-style check-imports
.PHONY: all
all: install lint test
.PHONY: test-in-docker
test-in-docker:
docker run -v `pwd`:/tmp -w /tmp python:$(or $(PYTHON_VERSION),3.10) make install test
.PHONY: all-in-docker
all-in-docker:
docker run -v `pwd`:/tmp -w /tmp python:$(or $(PYTHON_VERSION),3.10) make all
.PHONY: bump
bump:
bump2version $(filter-out $@,$(MAKECMDGOALS))
@git --no-pager show HEAD
@echo
@git verify-commit HEAD
@git verify-tag `git describe`
@echo
# git push origin master --tags
%:
@: