-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
59 lines (50 loc) · 1.38 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
##
## Makefile (for developers)
##
package_name = poulda
## WARNING: tmp_dir is deleted in the 'clean' rule. Be sure not to use
## "/tmp", "." or any directory that may contain anything else.
tmp_dir = /tmp/$(package_name)-distcheck
tmp_src_dir = $(tmp_dir)/src
tmp_cov_dir = $(tmp_dir)/coverage-output
tmp_env_dir = $(tmp_dir)/testing-env
.PHONY: _default
_default:
@echo "make clean|cov|coverage|doc|dist|distcheck|qa|test"
.PHONY: clean
clean:
rm -rf .coverage
rm -rf ./dist/ ./build
rm -rf $(tmp_dir)
find . -name "*.pyc" | xargs rm
.PHONY: coverage
coverage:
coverage run setup.py test -q
coverage html -d "$(tmp_cov_dir)"
open "$(tmp_cov_dir)/index.html"
@echo "Coverage information is available at '$(tmp_cov_dir)'."
cov: coverage
PHONY: dist
dist:
python setup.py sdist
.PHONY: distcheck
distcheck: clean dist
virtualenv --no-site-packages $(tmp_env_dir)
$(tmp_env_dir)/bin/easy_install nose
$(tmp_env_dir)/bin/easy_install coverage
mkdir -p $(tmp_src_dir)
@name=`python setup.py --name` && \
ver=`python setup.py --version` && \
tar xfz ./dist/$$name-$$ver.tar.gz -C $(tmp_src_dir) && \
cd $(tmp_src_dir)/$$name-$$ver && \
$(tmp_env_dir)/bin/python setup.py install && \
$(tmp_env_dir)/bin/nosetests
.PHONY: qa
qa:
pep8 -r setup.py || true
pep8 -r $(package_name) || true
pyflakes setup.py
pyflakes $(package_name)
.PHONY: test
test:
PYTHONWARNINGS=all nosetests