-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathMakefile
68 lines (48 loc) · 1.85 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
.EXPORT_ALL_VARIABLES:
.PHONY: help requirements-dev-upgrade
SRC = EMpy
SRC_TEST = tests
REQUIREMENTS = requirements.txt requirements_dev.txt
# Self-documenting Makefile
# https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help: ## Print this help
@grep -E '^[a-zA-Z][a-zA-Z0-9_-]*:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
venv: ## Create venv for EMpy
mkvirtualenv EMpy
develop: upgrade-dev requirements-install ## Install project for development
pip install -e .
upgrade-dev: ## Upgrade packages for development
pip install -U setuptools pip pip-tools pytest tox
test: lint ## Run tests
pytest
tox: ## Run Python tests
tox
black: ## Run formatter
black .
lint: flake8 pyflakes mypy ## Run linters
flake8: ## Run flake8 linter
flake8 ${SRC} tests examples scripts
pyflakes: ## Run pyflake linter
pyflakes ${SRC} tests examples scripts
mypy: ## Run mypy linter
mypy ${SRC} tests examples scripts
requirements: ${REQUIREMENTS} ## Create requirements files
requirements.txt: setup.py
pip-compile -v ${PIP_COMPILE_ARGS} --output-file requirements.txt setup.py
%.txt: %.in
pip-compile -v ${PIP_COMPILE_ARGS} --output-file $@ $<
requirements-upgrade: PIP_COMPILE_ARGS += --upgrade
requirements-upgrade: requirements ## Upgrade requirements
requirements-sync: requirements ## Synchronize requirements
pip-sync ${REQUIREMENTS}
pip install -e .
requirements-install: requirements ## Install requirements
$(foreach req, ${REQUIREMENTS}, pip install --no-binary :all: -r $(req);)
clean-repo:
git diff --quiet HEAD # no pending commits
git diff --cached --quiet HEAD # no unstaged changes
git pull --ff-only # latest code
release: requirements clean-repo ## Make a release (specify: PART=[major|minor|patch])
bump2version ${PART}
git push
git push --tags