forked from juju/amulet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
97 lines (77 loc) · 1.85 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
PY := venv/bin/python
# If the bin version does not exist look in venv/local/bin
ifeq ($(wildcard venv/bin/pip),)
PIP = venv/local/bin/pip
else
PIP = venv/bin/pip
endif
# If the bin version does not exist look in venv/local/bin
ifeq ($(wildcard venv/bin/nosetests-3.3),)
NOSE = venv/local/bin/nosetests-3.3
else
NOSE = venv/bin/nosetests-3.3
endif
# ###########
# Build
# ###########
.PHONY: install
install: venv develop
venv: $(PY)
$(PY):
python3 -m venv venv
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | $(PY)
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | $(PY)
rm setuptools*.tar.gz
.PHONY: clean_all
clean_all: clean clean_venv
.PHONY: clean_venv
clean_venv:
rm -rf venv
.PHONY: clean
clean:
find . -name '*.pyc' -delete
find . -name '*.bak' -delete
rm -f .coverage
develop: lib/python*/site-packages/aumlet.egg-link
lib/python*/site-packages/aumlet.egg-link:
$(PY) setup.py develop
.PHONY: sysdeps
sysdeps:
sudo apt-get install python3-dev
# ###########
# Develop
# ###########
$(NOSE): $(PY)
$(PIP) install -r test-requires.txt
.PHONY: test
test: $(NOSE)
make py3test
# This is a private target used to get around finding nose in different paths.
# Do not call this manually, just use make test.
.PHONY: py3test
py3test:
@echo Testing Python 3...
@$(NOSE) --nologcapture
.PHONY: coverage
coverage:
@echo Testing with coverage...
@$(NOSE) --nologcapture --with-coverage --cover-package=juju_tests
.PHONY: lint
lint:
@find $(sources) -type f \( -iname '*.py' ! -iname '__init__.py' ! -iwholename '*venv/*' \) -print0 | xargs -r0 flake8
.PHONY: check
check: test lint
.PHONY: all
all: clean venv coverage lint
# ###########
# Deploy
# ###########
.PHONY: dist
dist:
$(PY) setup.py sdist
.PHONY: upload
upload:
$(PY) setup.py sdist upload
.PHONY: version_update
version_update:
$(EDITOR) setup.py