-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile
67 lines (53 loc) · 1.48 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
ROOTPATH := .
DEVPATH = $(ROOTPATH)/.dev
DEVMKFILE := $(DEVPATH)/makefile
SRCPATH := $(ROOTPATH)/ycyc
# ENV VARS
PYENV := env PYTHONPATH=$(ROOTPATH)
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
dev-mk:
@echo "\033[33mmake from $(DEVMKFILE)\033[0m"
.PHONY: clean
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"
.PHONY: full-clean
full-clean: clean
@git clean -f
.PHONY: pylint
pylint:
$(PEP8) $(SRCPATH)
$(PYLINT) -E $(SRCPATH)
.PHONY: pylint-full
pylint-full:
$(PYLINT) $(SRCPATH)
.PHONY: pytest
pytest:
$(PYTEST) $(SRCPATH)/tests/
.PHONY: test
test: pylint pytest
.PHONY: ci
ci: pytest
.PHONY: requires
requires: $(ROOTPATH)/requirements.txt
$(PIPINSTALL) -r $(ROOTPATH)/requirements.txt
.PHONY: ipy
ipy:
$(PYENV) ipython
.PHONY: author-config
author-config:
git config user.email [email protected] --local
git config user.name MrLYC --local
.PHONY: publish
publish:
git pull --rebase origin master --tags
$(PYTHON) $(ROOTPATH)/setup.py clean bdist_egg sdist upload
git tag `$(PYTHON) $(ROOTPATH)/setup.py --version`
git push origin master:master --tags