-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
129 lines (103 loc) · 2.95 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
SHELL := /bin/bash
# List of targets the `readme` target should call before generating the readme
export README_TEMPLATE_FILE ?= .README.md.gotmpl
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)
-include $(shell curl -sSL -o $(README_TEMPLATE_FILE) "https://git.io/enter-at-readme")
project-name = lambda_handlers
version-var := "__version__ = "
version-string := $(shell grep $(version-var) $(project-name)/version.py)
version := $(subst __version__ = ,,$(version-string))
.PHONY : help
help:
@echo "install - install"
@echo "install-dev - install also development dependencies"
@echo "clean-all - clean all below"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-tox - clean tox cache"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test-cov - run tests with the default Python and report coverage"
@echo "test-dbg - run tests and debug with pdb"
@echo "develop - run tests in loop mode"
@echo "deploy - deploy"
@echo "mypy - check type hinting with mypy"
@echo "isort - sort imports"
@echo "isort-check - check if your imports are correctly sorted"
@echo "build - create the distribution package"
@echo "docs - build the documentation pages"
@echo "docs-serve - build and serve locally the documentation pages"
@echo "release - package a release in wheel and tarball, requires twine"
.PHONY : install
install:
python -m pip install .
.PHONY : install-ci
install-ci:
pip install -r dev-requirements.txt
python -m pip install -e .
.PHONY : install-dev
install-dev: install-ci
pre-commit install
.PHONY : clean-all
clean-all: clean-build clean-pyc clean-caches
.PHONY : clean-build
clean-build:
rm -fr build/
find . -name 'dist' -exec rm -rf {} +
find . -name '.eggs' -exec rm -rf {} +
find . -name '*.egg-info' -delete
find . -name '*.spec' -delete
.PHONY : clean-pyc
clean-pyc:
find . -name '*.py?' -delete
find . -name '*~' -exec rm -f {} +
find . -name __pycache__ -exec rm -rf {} +
find . -name '*.log*' -delete
find . -name '*_cache' -exec rm -rf {} +
find . -name '*.egg-info' -exec rm -rf {} +
.PHONY : clean-caches
clean-caches:
find . -name '.tox' -exec rm -rf {} +
find . -name '.pytest_cache' -exec rm -rf {} +
.PHONY : lint
lint:
tox -e lint
.PHONY : test
test:
tox -e tests
.PHONY : mypy
mypy:
tox -e mypy
.PHONY : isort-check
isort-check:
tox -e isort
.PHONY : isort
isort:
isort lambda_handlers/
.PHONY : test-cov
test-cov:
py.test --cov-report term-missing --cov=$(project-name)
.PHONY : test-dbg
test-dbg:
py.test --pdb
.PHONY : test-develop
develop:
py.test --color=yes -f
.PHONY : coverage
coverage:
pytest --cov=hansel
coverage report -m
.PHONY : docs
docs:
tox -e docs
.PHONY : docs-serve
docs-serve:
tox -e docs -- serve
.PHONY : build
build:
python setup.py sdist bdist_wheel
.PHONY : pypi
pypi:
twine upload dist/*
.PHONY : release
release: clean build pypi