-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (61 loc) · 1.48 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
69
70
71
72
73
74
75
76
77
78
79
.DEFAULT_GOAL := build
.PHONY: build publish package coverage test lint docs venv
PROJ_SLUG = shapeit
CLI_NAME = shapeit
PY_VERSION = 3.6
GREEN = 2
RED = 1
define colorecho
@tput bold
@tput setaf $1
@echo $2
@tput sgr0
endef
build:
pip install --editable .
run:
$(CLI_NAME) run
submit:
$(CLI_NAME) submit
freeze:
pip freeze > requirements.txt
lint:
pylint $(PROJ_SLUG)
test: lint
py.test --cov-report term --cov=$(PROJ_SLUG) tests/
quicktest:
py.test --cov-report term --cov=$(PROJ_SLUG) tests/
coverage: lint
py.test --cov-report html --cov=$(PROJ_SLUG) tests/
docs: coverage
mkdir -p docs/source/_static
mkdir -p docs/source/_templates
cd docs && $(MAKE) html
pandoc --from=markdown --to=rst --output=README.rst README.md
answers:
cd docs && $(MAKE) html
xdg-open docs/build/html/index.html
package: clean docs
python setup.py sdist
publish: package
twine upload dist/*
clean :
rm -rf dist \
rm -rf docs/build \
rm -rf *.egg-info
coverage erase
venv :
virtualenv --python python$(PY_VERSION) venv
@echo
@echo To activate the environment, use the following command:
@echo
$(call colorecho, $(GREEN), "source venv/bin/activate")
@echo
@echo Once activated, you can use the 'install' target to install dependencies:
@echo
$(call colorecho, $(GREEN), "source venv/bin/activate")
install:
pip install -r requirements.txt
licenses:
pip-licenses --with-url --format=rst \
--ignore-packages $(shell cat .pip-license-ignore | awk '{$$1=$$1};1')