-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
55 lines (48 loc) · 1.44 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
.DEFAULT_GOAL := help
.PHONY: test
test: # Run tests with pytest and coverage
test:
@echo "+ $@"
coverage erase
coverage run -m pytest -v --disable-warnings
coverage report -m
.PHONY: notebook
notebook: # Run notebook with runpynb
notebook:
@echo "+ $@"
cd examples && runpynb readme-examples.ipynb
BLACK_OPTS := -l 95
SRC_FILES := arg_validators dataframe_utils graph_utils plot text_utils
SRC_FILES := $(addprefix forestplot/, $(addsuffix .py, $(SRC_FILES)))
.PHONY: lint
lint: # Check with mypy, pyflakes, black
lint:
@echo "+ $@"
mypy $(SRC_FILES) --ignore-missing-imports
python -m pyflakes tests/*.py $(SRC_FILES)
python -m pyflakes setup.py
isort --profile black $(BLACK_OPTS) .
black forestplot/*.py $(BLACK_OPTS)
black forestplot/*.py $(BLACK_OPTS)
black tests/*.py $(BLACK_OPTS)
black setup.py $(BLACK_OPTS)
.PHONY: docstring
docstring: # Check docstrings using pydocstyle
pydocstyle --convention numpy
.PHONY: prepack
prepack: # Prepare packaging for PyPi
prepack:
@echo "+ $@"
@rm -rf dist/ forestplot.egg-info/
@rm -rf dist/ pyforestplot.egg-info/
@python setup.py sdist bdist_wheel
twine check dist/*
PACKAGE_FILES := build/ dist/ *.egg-info/ *.egg-info *.egg
.PHONY: cleanpack
cleanpack: # Remove distribution/packaging files
cleanpack:
@echo "+ $@"
@rm -rf $(PACKAGE_FILES)
.PHONY: help
help: # Show Help
@egrep -h '\s#\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'