-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
52 lines (40 loc) · 1.37 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
ROOTPATH := .
DEVPATH = $(ROOTPATH)/.dev
DEVMKFILE := $(DEVPATH)/makefile
SRCPATH := $(ROOTPATH)/schemaconvertor
# ENV VARS
PYENV := env PYTHONPATH=$(SRCPATH)
PYTHON := $(PYENV) python
PEP8 := $(PYENV) pep8 --repeat --ignore=E202,E501
PYLINT := $(PYENV) pylint --disable=I0011 --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"
PYTEST := $(PYENV) py.test -v
PIPINSTALL := $(PYENV) pip install -i http://pypi.douban.com/simple/
-include $(DEVMKFILE)
.PHONY: dev-mk clean full-clean pylint pylint-full test requires ci-test
dev-mk:
@echo "\033[33mmake from $(DEVMKFILE)\033[0m"
clean:
@find . -name "__pycache__" -type d -exec rm -rf {} \; >/dev/null 2>&1 || true
@find . -name "*.pyc" -type f -exec rm -rf {} \; >/dev/null 2>&1 || true
@echo "\033[33mclean $(SRCPATH)\033[0m"
pylint:
$(PEP8) $(SRCPATH)
$(PYLINT) -E $(SRCPATH)
pylint-full:
$(PYLINT) $(SRCPATH)
test: pylint
$(PYTEST) $(SRCPATH)
ci-test: pylint
$(PYTEST) --cov=./ $(SRCPATH)
requires: $(ROOTPATH)/requirements.txt
$(PIPINSTALL) -r $(ROOTPATH)/requirements.txt
pypi-upload:
git branch | grep "* master" || exit 1
pandoc README.md -o README.rst
$(PYTHON) setup.py clean bdist_egg sdist upload || exit 2
$(PYTHON) setup.py clean
git tag `$(PYTHON) setup.py --version`
git rebase master dev
author-config:
git config user.email [email protected] --local
git config user.name MrLYC --local