From c6690e0182ac924e30a7c4800686f26a0aa7e5ad Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Sat, 2 Jan 2016 14:33:48 -0300 Subject: [PATCH] Makefile improvements --- Makefile | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index ce47d6e5..89e0342e 100644 --- a/Makefile +++ b/Makefile @@ -7,45 +7,36 @@ REQUIREMENTS="requirements-dev.txt" TAG="\n\n\033[0;32m\#\#\# " END=" \#\#\# \033[0m\n" + all: test -uninstall-httpie: - @echo $(TAG)Uninstalling httpie$(END) - @echo - - pip uninstall --yes httpie &2>/dev/null - @echo "Verifying…" - cd .. && ! python -m httpie --version &2>/dev/null - @echo "Done" - @echo - -uninstall-all: uninstall-httpie - - @echo $(TAG)Uninstalling httpie requirements$(END) - - pip uninstall --yes pygments requests - - @echo $(TAG)Uninstalling development requirements$(END) - - pip uninstall --yes -r $(REQUIREMENTS) init: uninstall-httpie @echo $(TAG)Installing dev requirements$(END) pip install --upgrade -r $(REQUIREMENTS) + @echo $(TAG)Installing HTTPie$(END) pip install --upgrade --editable . + @echo + test: init @echo $(TAG)Running tests on the current Python interpreter with coverage $(END) py.test --cov ./httpie --cov ./tests --doctest-modules --verbose ./httpie ./tests @echo + test-tox: init @echo $(TAG)Running tests on all Pythons via Tox$(END) tox @echo + test-dist: test-sdist test-bdist-wheel @echo + test-sdist: clean uninstall-httpie @echo $(TAG)Testing sdist build an installation$(END) python setup.py sdist @@ -53,6 +44,7 @@ test-sdist: clean uninstall-httpie which http @echo + test-bdist-wheel: clean uninstall-httpie @echo $(TAG)Testing wheel build an installation$(END) python setup.py bdist_wheel @@ -60,9 +52,11 @@ test-bdist-wheel: clean uninstall-httpie which http @echo + # This tests everything, even this Makefile. test-all: uninstall-all clean init test test-tox test-dist + publish: test-all @echo $(TAG)Testing wheel build an installation$(END) @echo "$(VERSION)" @@ -72,8 +66,29 @@ publish: test-all python setup.py bdist_wheel upload @echo + clean: @echo $(TAG)Cleaning up$(END) rm -rf .tox *.egg dist build .coverage find . -name '__pycache__' -delete -print -o -name '*.pyc' -delete -print @echo + + +uninstall-httpie: + @echo $(TAG)Uninstalling httpie$(END) + - pip uninstall --yes httpie &2>/dev/null + + @echo "Verifying…" + cd .. && ! python -m httpie --version &2>/dev/null + + @echo "Done" + @echo + + +uninstall-all: uninstall-httpie + + @echo $(TAG)Uninstalling httpie requirements$(END) + - pip uninstall --yes pygments requests + + @echo $(TAG)Uninstalling development requirements$(END) + - pip uninstall --yes -r $(REQUIREMENTS)