This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
64 lines (54 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
##
## Makefile (for developers)
##
package_name = basket
## 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|dist|distcheck|qa|sass|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 nosetests
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
$(tmp_env_dir)/bin/easy_install readline
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: upload
upload:
python setup.py sdist upload
.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