-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
72 lines (61 loc) · 1.69 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
##
## Makefile (for developers)
##
package_name = awstatic
## 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/
rm -rf $(tmp_dir)
rm -rf .tox
find . -name "__pycache__" | xargs rm -rf
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
doc:
cd docs && make html
cd ..
.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: qa
qa:
pep8 -r --ignore=E121,E123,E127 setup.py || true
pep8 -r --ignore=E121,E123,E127 $(package_name) || true
pyflakes setup.py
pyflakes $(package_name)
.PHONY: sass
sass:
cd awstatic/template/assets/css && \
sass --watch src:. --style compressed
.PHONY: test
test:
PYTHONWARNINGS=all nosetests && \
open awstatic/tests/js/tests.html