From 7c152b52f50d814458afb31ae3fd838094393d6f Mon Sep 17 00:00:00 2001 From: Devin Schwab Date: Sun, 24 May 2015 20:43:01 -0400 Subject: [PATCH] Added targets to automate the release process. --- .gitignore | 2 ++ Makefile | 28 ++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 64758ba..8c9aba2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +lspi-python-docs.zip + # Livereload Gemfile Gemfile.lock diff --git a/Makefile b/Makefile index f7d7342..00df07f 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ -.PHONY: html-docs clean clean-pyc test all flake8 sphinx-apidoc travis-test +.PHONY: html-docs clean clean-pyc clean-tests clean-releases test all flake8 sphinx-apidoc travis-test release upload-release all: lspienv flake8 test html-docs lspienv: lspienv/bin/activate - + lspienv/bin/activate: requirements.txt test -d lspienv || virtualenv lspienv . lspienv/bin/activate; pip install -Ur requirements.txt touch lspienv/bin/activate - + flake8: . lspienv/bin/activate; flake8 lspi @@ -18,9 +18,9 @@ sphinx-apidoc: html-docs: sphinx-apidoc . lspienv/bin/activate; PYTHONPATH=.. $(MAKE) -C docs html -clean: clean-pyc clean-docs - - +clean: clean-pyc clean-docs clean-tests clean-releases + + clean-pyc: find . -name '*.pyc' -exec rm -f {} + find . -name '*.pyo' -exec rm -f {} + @@ -28,8 +28,24 @@ clean-pyc: clean-docs: $(MAKE) -C docs clean +clean-releases: + rm -rf dist/ + rm -rf lspi_python.egg-info/ + rm -rf build/ + rm -f lspi-python-docs.zip + +clean-tests: + rm -rf htmlcov/ + test: . lspienv/bin/activate; nosetests --config=setup.cfg lspi_testsuite travis-test: nosetests --config=setup.cfg lspi_testsuite + +release: lspienv flake8 test html-docs + . lspienv/bin/activate; python setup.py sdist bdist_wheel + zip -r lspi-python-docs.zip docs/build/html/* + +upload-release: release + . lspienv/bin/activate; twine upload -p $@ dist/*