-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (49 loc) · 1.5 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
SHELL = /bin/sh
.DEFAULT_GOAL := help
.PHONY: devenv
.venv:
@python3 --version
python3 -m venv $@
# upgrading package managers
$@/bin/pip install --upgrade \
pip \
wheel \
setuptools
devenv: .venv ## create a python virtual environment with tools to dev, run and tests cookie-cutter
# installing extra tools
@$</bin/pip3 install pip-tools
# your dev environment contains
@$</bin/pip3 list
@echo "To activate the virtual environment, run 'source $</bin/activate'"
.PHONY: install-test
install-test: ## install dependencies for testing
pip install -r requirements/test.in
pip list --verbose
.PHONY: tests-dev
tests-dev: ## run tests in development mode
.venv/bin/pytest --pdb -vvv tests
.PHONY: tests-ci
tests-ci: ## run testds in the CI
.venv/bin/pytest -vvv --color=yes --cov-report term --cov=activity_monitor --cov=activity tests
.PHONY: release
release: ## triggers the CI to create a new release from the tag, usage: `make release tag=vX.X.X`
@git fetch --tags
@if git tag -l | grep -q "^${tag}$$"; then \
echo "Tag '${tag}' already exists. Exiting."; \
exit 1; \
fi
@echo "Releasing: '${tag}'. Is this correct? (y/n)"
@read -r answer; \
if [ "$$answer" != "y" ]; then \
echo "Exiting."; \
exit 1; \
fi
@git tag "${tag}"
@git push
@git push --tags
.PHONY: help
help: ## this colorful help
@echo "Recipes for '$(notdir $(CURDIR))':"
@echo ""
@awk 'BEGIN {FS = ":.*?## "} /^[[:alpha:][:space:]_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""