This repository has been archived by the owner on Oct 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (52 loc) · 2.02 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
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[\.a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: check
check: bandit black-check pip-check test ## Run all checks
.PHONY: bandit
bandit: ## Run bandit
python -m bandit -r vertrag
.PHONY: black-check
black-check: ## Check code formatting
python -m black --check vertrag
.PHONY: black
black: ## Format code
python -m black vertrag
.PHONY: test
test: ## Run unittests
python -m pytest --cov=./ $(PYTEST_ARGS)
.PHONY: git-flow
git-flow: ## Initialize git-flow
@if [ $$(git-flow version 2>/dev/null | grep -c AVH) -lt 1 ]; then \
echo "You need to have gitflow-avh installed" >&2; \
exit 1; \
fi
grep -q '^\[gitflow ' .git/config || git-flow init -d
.PHONY: pip-sync
pip-sync: ## Install all dev dependencies
python -m pip install "$$(grep '^pip-tools=' requirements-dev.txt)"
python -m piptools sync requirements-dev.txt
.PHONY: develop
develop: git-flow pip-sync pip-check ## Setup repository for development
.PHONY: pip-check
pip-check: ## Verify that all python package dependencies are met
python -m pip check
# Sets the annotation content for the files generated by pip-compile
export CUSTOM_COMPILE_COMMAND := make update-requirements
.PHONY: update-requirements
update-requirements: ## Regenerate requirements.txt with newest versions of dependencies
python -m piptools compile --rebuild --upgrade --quiet requirements.in
python -m piptools compile --rebuild --upgrade --quiet requirements-dev.in
.PHONY: upgrade
upgrade: ## Update all packages as available
python -m pip install --upgrade-strategy eager --upgrade $$(cat requirements.in | sed -n 's/==.*$$//p')
python -m pip install --upgrade-strategy eager --upgrade $$(cat requirements-dev.in | sed -n 's/==.*$$//p')
.PHONY: install
install: ## Install the package
pip install -e .
.PHONY: uninstall
uninstall: ## Remove the currently installed version of vertrag
pip uninstall -y vertrag
.PHONY: reinstall
reinstall: uninstall install