-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (39 loc) · 1.17 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
# vim: noexpandtab filetype=make
PLUGIN_NAME := yf_stock_ticker
SUBDIR := $(PLUGIN_NAME)
PYTHON := venv/bin/python3
SHELLCHECK := venv/bin/shellcheck
.PHONY: help
.DEFAULT: help
help:
@echo "make all"
@echo " prepare development environment, lint and test"
@echo "make venv"
@echo " prepare development environment"
@echo "make lint"
@echo " run linting"
@echo "make test"
@echo " run tests"
@echo "make build"
@echo " build release"
@echo "make clean"
@echo " remove all development files and directories"
venv: venv/bin/activate
venv/bin/activate: requirements_dev.txt
python3 -m venv venv
$(PYTHON) -m pip install -U pip wheel
$(PYTHON) -m pip install -r requirements_dev.txt
lint: venv $(SUBDIR)/*.sh $(SUBDIR)/*.py
$(SHELLCHECK) $(SUBDIR)/*.sh
$(PYTHON) -m pylint $(SUBDIR)/*.py
test: venv $(SUBDIR)/*.py tests/*.py
$(PYTHON) -m pytest -v -x
all: lint test
clean_bytecode: venv
$(PYTHON) -m pyclean . --debris
build: clean_bytecode $(SUBDIR)/*.*
RELEASE=$$($(SUBDIR)/$(PLUGIN_NAME).sh --version) ;\
tar --uid=0 --gid=0 -zcvf $(PLUGIN_NAME)_$${RELEASE}.tgz $(SUBDIR)
clean: clean_bytecode
rm -rf venv
rm -f $(PLUGIN_NAME)_*.tgz