forked from chrisgilmerproj/brewday
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (40 loc) · 1.29 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
#! /usr/bin/make
PACKAGE_NAME=brew
VENV_DIR?=.venv
VENV_ACTIVATE=$(VENV_DIR)/bin/activate
WITH_VENV=. $(VENV_ACTIVATE);
TEST_OUTPUT?=nosetests.xml
COVERAGE_OUTPUT?=coverage.xml
.PHONY: help venv setup clean teardown lint test package
help: ## Print the help documentation
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
$(VENV_ACTIVATE): requirements.txt requirements-dev.txt
test -f $@ || virtualenv --python=python2.7 $(VENV_DIR)
$(WITH_VENV) pip install --no-deps -r requirements.txt
$(WITH_VENV) pip install --no-deps -r requirements-dev.txt
touch $@
venv: $(VENV_ACTIVATE)
setup: venv
clean: ## Clean the library and test files
python setup.py clean
rm -rf build/
rm -rf dist/
rm -rf *.egg*/
rm -f MANIFEST
rm -f $(TEST_OUTPUT)
coverage erase || rm -f .coverage
rm -f $(COVERAGE_OUTPUT)
find ./ -type d -name '__pycache__' -delete
find ./ -type f -name '*.pyc' -delete
teardown: ## Remove all virtualenv files
rm -rf $(VENV_DIR)/
rm -rf .tox/
lint: venv ## Run linting tests
$(WITH_VENV) flake8 $(PACKAGE_NAME)/
test: ## Run unit tests
tox
package: ## Create the python package
python setup.py build
install: ## Install the python package
$(WITH_VENV) python setup.py install
default: help