-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
72 lines (63 loc) · 1.7 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
.DEFAULT_GOAL := about
VERSION := $(shell cat pybmoore/__init__.py | grep '__version__ =' | cut -d'"' -f 2)
USE_CYTHON := false
lint:
ifeq ($(SKIP_STYLE), )
@echo "> running isort..."
isort setup.py
isort pybmoore
isort tests
@echo "> running black..."
black setup.py
black pybmoore
black tests
endif
@echo "> running bandit"
bandit -r -ll -ii -s B104 pybmoore
@echo "> running radon"
radon cc -s -n B pybmoore tests
@echo "> running flake8..."
flake8 setup.py
flake8 pybmoore
flake8 tests
@echo "> running mypy..."
mypy pybmoore
tests:
@echo "> unittest"
python -m pytest --durations=10 -vv --no-cov-on-fail --color=yes --cov-report xml --cov-report term --cov=pybmoore tests
ci: lint tests
ifeq ($(GITHUB_HEAD_REF), false)
@echo "> uploading coverage report..."
codecov -f coverage.xml -t $$CODECOV_TOKEN
endif
tox:
@echo "> running tox..."
tox -r -p all
build:
@echo "> building package..."
python setup.py build_ext -i
python setup.py sdist
@echo "OK"
clean:
@echo "> cleaning up the environment"
@rm pybmoore/_bm.c | true
@rm pybmoore/*.so | true
@rm pybmoore/*.html | true
@rm dist/*.tar.gz | true
ifeq ($(FORCE), true)
@rm pybmoore/_bm.c | true
endif
@echo "OK"
about:
@echo "> pybmoore [$(VERSION)]"
@echo ""
@echo "make lint - Runs: [isort > black > flake8 > mypy]"
@echo "make tests - Runs: [tests]"
@echo "make ci - Runs: [lint > tests]"
@echo "make tox - Runs: [tox]"
@echo "make clean - Clean the environment for a new build [flag available, default FORCE=false]."
@echo "make build - Build package [flag available, default USE_CYTHON=false]."
@echo ""
@echo "mailto: [email protected]"
all: build ci tox
.PHONY: lint tests ci tox clean build all