-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (44 loc) · 1.72 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
EXEC := build
WHEEL := corti
all: test
##-------------------------------------------------------------------
## Python dev convenience rules
##-------------------------------------------------------------------
bundle: clean ${EXEC}
dev:
@pipenv install --dev
@pipenv run pip install -e .
@echo "installed development version; run \`pipenv shell\` to enter activated environment."
test:
@pipenv run pytest --cov-report term-missing --cov=${WHEEL} tests/
lint:
@echo "======== PYLINT ======="
@pipenv run pylint --rcfile=.pylintrc ${WHEEL} -f parseable -r n
@echo "======== MYPY ======="
@pipenv run mypy --ignore-missing-imports --follow-imports=skip ${WHEEL}
@echo "======== PYCODESTYLE ======="
@pipenv run pycodestyle ${WHEEL} --max-line-length=120
@echo "======== PYDOCSTYLE ======="
@pipenv run pydocstyle ${WHEEL}
# Define all non-file tagets here
.PHONY: ${WHEEL} bundle clean mrproper lint test dev help
##-------------------------------------------------------------------
## Wheel building rules
##-------------------------------------------------------------------
${EXEC}: requirements.txt ${WHEEL}
@echo "adding to pex"
# build pex file
@pipenv run pex --python-shebang='/usr/bin/env python3' -r $< -f wheels ${WHEEL} -c $@ -o $@
@chmod 755 $@
requirements.txt: Pipfile
@pipenv lock --requirements > $@
${WHEEL}:
# generate a new one (deps should already be present)
@pipenv run pip wheel -w wheels --no-deps .
##-------------------------------------------------------------------
## House keeping rules
##-------------------------------------------------------------------
clean:
@rm -f ${EXEC}
mrproper: clean
@rm -f wheels/* requirements.txt