-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
68 lines (56 loc) · 1.77 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
# Variables you might need to change in the first place
#
# This is probably the only section you'll need to change in this Makefile.
# Also, make sure you don't remove the `<variables/>' tag. Cause those marks
# are going to be used to update this file automatically.
#
# <variables>
PACKAGE=pyrelic
CUSTOM_PIP_INDEX=
# </variables>
all: unit functional integration acceptance
unit:
@make run_test suite=unit
functional:
@make run_test suite=functional
integration:
@make run_test suite=integration
acceptance:
@if hash lettuce 2>/dev/null; then \
lettuce; \
fi
prepare: clean install_deps
run_test:
@if [ -d tests/$(suite) ]; then \
echo "Running \033[0;32m$(suite)\033[0m test suite"; \
make clean && \
nosetests --stop --with-coverage --cover-package=$(PACKAGE) \
--cover-branches --verbosity=2 -s tests/$(suite); \
fi
install_deps:
@if [ -z $$VIRTUAL_ENV ]; then \
echo "You're not running this from a virtualenv, wtf dude?"; \
exit 1; \
fi
@if [ -z $$SKIP_DEPS ]; then \
echo "Installing missing dependencies..."; \
pip install -e ".[tests]"; \
fi
@python setup.py develop &> .build.log
clean:
@echo "Removing garbage..."
@find . -name '*.pyc' -delete
@find . -name '*.so' -delete
@find . -name __pycache__ -delete
@rm -rf .coverage *.egg-info *.log build dist MANIFEST
publish:
@if [ -e "$$HOME/.pypirc" ]; then \
echo "Uploading to '$(CUSTOM_PIP_INDEX)'"; \
python setup.py register -r "$(CUSTOM_PIP_INDEX)"; \
python setup.py sdist upload -r "$(CUSTOM_PIP_INDEX)"; \
else \
echo "You should create a file called \`.pypirc' under your home dir.\n"; \
echo "That's the right place to configure \`pypi' repos.\n"; \
echo "Read more about it here: https://github.com/Yipit/yipit/blob/dev/docs/rfc/RFC00007-python-packages.md"; \
exit 1; \
fi