-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
74 lines (59 loc) · 1.35 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
SHELL := /bin/bash
PIP_ENV:=$(shell pipenv --venv)
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DESTDIR ?= ~/.local/bin/
SIGN := 1
ifeq ($(OS),Windows_NT)
UNAME := Windows
else
UNAME := $(shell uname -s)
endif
.PHONY: shell
shell:
@pipenv shell
.PHONY: setup
setup: set-hooks
@pipenv sync --dev
.PHONY: Pipfile.lock
Pipfile.lock:
@pipenv lock
.PHONY: requirements.txt
requirements.txt:
@echo "Generating requirements.txt"
@echo "# DO NOT EDIT. This file is generated by running 'make requirements.txt'" > requirements.txt
@pipenv requirements --hash >> requirements.txt
.PHONY: set-hooks
set-hooks:
@echo "Setting commit hooks"
@ ([ ! -L ".git/hooks/pre-commit" ] && \
ln -s $(PWD)/scripts/git-hooks/pre-commit.sh .git/hooks/pre-commit) \
|| true
.PHONY: format
format:
@pipenv run black -l 79 ./mtls/*.py
@pipenv run black -l 79 ./test/*.py
.PHONY: lint
lint:
@pipenv run pycodestyle **/*.py
.PHONY: build
build: setup
@pipenv run python -m build
.PHONY: run
run:
@pipenv run python3 bin/mtls $(ARGS)
.PHONY: test
test: setup
-@pipenv run coverage run -m unittest -v
.PHONY: test-by-name
test-by-name:
-@pipenv run coverage run -m unittest $(NAME) -v
.PHONY: coverage
coverage:
-@pipenv run coverage report -m
.PHONY: coveralls
coveralls:
@pipenv run coveralls
.PHONY: clean
clean:
@rm dist || true
@pipenv clean