-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (45 loc) · 1.34 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
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
# Directory Structure
PROJECT_NAME = beedle
REQUIREMENTS = requirements.txt
TEST_DIRECTORY = test
TOOLS_DIRECTORY = tools
# Virtual Environment
PY = python3
BIN = bin
# Requirements
REQ_DIR = req
all: install lint test
.PHONY: install
install:
> $(BIN)/pip install -I -r $(REQUIREMENTS)
.PHONY: localbuild
localbuild:
> $(PY) setup.py build_ext --inplace
.PHONY: test
test:
> $(PY) -m pytest
.PHONY: collect_tests
collect_tests:
> $(PY) -m pytest --collect-only
.PHONY: lint
lint:
> $(BIN)/pylint --exit-zero --jobs 0 --recursive true $(PROJECT_NAME)
> $(BIN)/flake8 --exit-zero --show-source --statistics --benchmark $(PROJECT_NAME)
> $(BIN)/pylint --exit-zero --jobs 0 --recursive true $(TEST_DIRECTORY)
> $(BIN)/flake8 --exit-zero --show-source --statistics --benchmark $(TEST_DIRECTORY)
> $(BIN)/pylint --exit-zero --jobs 0 --recursive true $(TOOLS_DIRECTORY)
> $(BIN)/flake8 --exit-zero --show-source --statistics --benchmark $(TOOLS_DIRECTORY)
.PHONY: clean
clean:
> find . -type f -name *.pyc -delete
> find . -type d -name __pycache__ -delete