From 7fbf7b014107c8a17dd32e867d2d6ee4129538ee Mon Sep 17 00:00:00 2001 From: Andy Grabow Date: Fri, 23 Feb 2018 16:20:01 +0100 Subject: [PATCH] new makefile enhanced readme --- Makefile | 46 ++++++++++++++++++++++++++++++---------------- README.rst | 16 ++++++---------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index d43e90b..e2e5437 100644 --- a/Makefile +++ b/Makefile @@ -16,27 +16,29 @@ help: @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}' clean: clean-build clean-pyc + @echo "all clean now .." clean-build: ## remove build artifacts - rm -fr build/ - rm -fr dist/ - rm -fr htmlcov/ - rm -fr *.egg-info + @rm -fr build/ + @rm -fr dist/ + @rm -fr htmlcov/ + @rm -fr *.egg-info + @rm -rf .coverage + @rm -rf my_secrets clean-pyc: ## remove Python file artifacts - find . -name '*.pyc' -exec rm -f {} + - find . -name '*.pyo' -exec rm -f {} + - find . -name '*~' -exec rm -f {} + + @find . -name '*.pyc' -exec rm -f {} + + @find . -name '*.pyo' -exec rm -f {} + + @find . -name '*.orig' -exec rm -f {} + + @find . -name '*~' -exec rm -f {} + init: pipenv install --dev pipenv shell - pip install django init2: pipenv install --dev --two pipenv shell - pip install "django<2.0" lint: ## check style with flake8 @@ -56,10 +58,22 @@ coverage: ## check code coverage quickly with the default Python view-coverage: coverage open htmlcov/index.html -release: clean ## package and upload a release - python setup.py sdist upload - python setup.py bdist_wheel upload - -sdist: clean ## package - python setup.py sdist - ls -l dist +release: clean ## package and upload a release (working dir must be clean) + @while true; do \ + CURRENT=`python -c "import django_secrets; print(django_secrets.__version__)"`; \ + echo ""; \ + echo "=== The current version is $$CURRENT - what's the next one?"; \ + echo "==========================================================="; \ + echo "1 - new major version"; \ + echo "2 - new minor version"; \ + echo "3 - patch"; \ + echo ""; \ + read yn; \ + case $$yn in \ + 1 ) bumpversion major; break;; \ + 2 ) bumpversion minor; break;; \ + 3 ) bumpversion patch; break;; \ + * ) echo "Please answer 1-3.";; \ + esac \ + done + @python setup.py bdist_wheel && twine upload dist/* diff --git a/README.rst b/README.rst index 6f5d824..1175d55 100644 --- a/README.rst +++ b/README.rst @@ -1,15 +1,11 @@ -============================= -django-undeletable -============================= +django-undeletable |BuildStatus|_ |Coverage|_ +============================================================== -.. image:: https://badge.fury.io/py/django-undeletable.svg - :target: https://badge.fury.io/py/django-undeletable +.. |BuildStatus| image:: https://travis-ci.org/kakulukia/django-undeletable.svg +.. _BuildStatus: https://travis-ci.org/kakulukia/django-undeletable -.. image:: https://travis-ci.org/kakulukia/django-undeletable.svg?branch=master - :target: https://travis-ci.org/kakulukia/django-undeletable - -.. image:: https://codecov.io/gh/kakulukia/django-undeletable/branch/master/graph/badge.svg - :target: https://codecov.io/gh/kakulukia/django-undeletable +.. |Coverage| image:: https://codecov.io/gh/kakulukia/django-undeletable/branch/master/graph/badge.svg +.. _Coverage: https://codecov.io/gh/kakulukia/django-undeletable I have run into dozens of situations where data got deleted by accident or somebody