-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
105 lines (74 loc) · 2.5 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# simple makefile to simplify repetitive build env management tasks under posix
PYTHON := $(shell which python)
NOSETESTS := $(shell which nosetests)
INTERACTIVE := $(shell ([ -t 0 ] && echo 1) || echo 0)
UNAME_S := $(shell uname -s)
PROJECT_NAME := dps
ifeq ($(UNAME_S),Darwin)
OPEN := open
else
OPEN := xdg-open
endif
all: clean inplace test
# list what would be deleted by clean-repo
clean-repo-check:
@git clean -f -x -d -n
clean-dict:
@rm -f AutoDict_*
clean-pyc:
@find . -name "*.pyc" -exec rm {} \;
clean-so:
@find $(PROJECT_NAME) -name "*.so" -exec rm {} \;
clean-build:
@rm -rf build
clean-dist:
@rm -fr dist
@rm -fr $(PROJECT_NAME).egg-info
clean: clean-build clean-pyc clean-so clean-dict clean-dist
in: inplace # just a shortcut
inplace:
@$(PYTHON) setup.py build_ext -i
install: clean
@$(PYTHON) setup.py install
install-user: clean
@$(PYTHON) setup.py install --user
sdist: clean
@$(PYTHON) setup.py sdist --release
register:
@$(PYTHON) setup.py register --release
upload: clean
@$(PYTHON) setup.py sdist upload --release
test-code: inplace
@$(NOSETESTS) -v -a '!slow' -s tests
test-code-full: inplace
@$(NOSETESTS) -v -s tests
test-code-verbose: inplace
@$(NOSETESTS) -v -a '!slow' -s tests --nologcapture
test-installed:
@(mkdir -p nose && cd nose && \
$(NOSETESTS) -v -a '!slow' -s --exe tests && \
cd .. && rm -rf nose)
test-doc:
@$(NOSETESTS) -v -s --with-doctest --doctest-tests --doctest-extension=rst \
--doctest-extension=inc --doctest-fixtures=_fixture docs/
test-coverage:
@rm -rf coverage .coverage
@$(NOSETESTS) -s -v -a '!slow' --with-coverage \
--cover-erase --cover-branches \
--cover-html --cover-html-dir=coverage rootpy
@if [ "$(INTERACTIVE)" -eq "1" ]; then \
$(OPEN) coverage/index.html; \
fi;
test: test-code
trailing-spaces:
@find $(PROJECT_NAME) -name "*.py" | xargs perl -pi -e 's/[ \t]*$$//'
doc: inplace
@make -C docs/ html
check-rst:
@mkdir -p build
@$(PYTHON) setup.py --long-description | rst2html.py > build/README.html
@$(OPEN) build/README.html
pep8:
@pep8 --exclude=.git,extern $(PROJECT_NAME)
flakes:
@./ci/run-pyflakes