-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
46 lines (31 loc) · 1.05 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
.DEFAULT_GOAL := help
.PHONY: help # shows available commands
help:
@echo "\nAvailable commands:\n\n $(shell sed -n 's/^.PHONY:\(.*\)/ *\1\\n/p' Makefile)"
.PHONY: test # runs tests
test:
coverage run setup.py test
.PHONY: test_all # runs tests using detox, combines coverage and reports
test_all:
tox
make coverage
.PHONY: coverage # combines coverage and reports
coverage:
coverage combine || true
coverage report
.PHONY: lint
lint:
flake8
.PHONY: clean # removes build files
clean:
rm -rf dist/ build/ .tox/ *.egg-info
.PHONY: build # builds wheel and tar
build:
pip install -U twine wheel
python setup.py sdist bdist_wheel
.PHONY: release # runs clean, build, and then pushes to pypi
release: clean build
@echo && echo && echo _____________________ \
&& echo Check version: new $(shell grep "version =" setup.py) vs old $(shell curl -s https://pypi.python.org/pypi/uwsgi-tools/json | grep '"version"' | xargs)
@read -p "Release? [yN]: " -n 1 -r; \
if [ "$$REPLY" == "y" ]; then echo && twine upload -s dist/*; else echo "Aborted."; fi