Skip to content

Commit

Permalink
Update shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Oct 6, 2014
1 parent 94aef7c commit 721e089
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[bumpversion]
commit = True
current_version = 0.7.0
files = django_markdown/__init__.py
tag = True
tag_name = {new_version}

72 changes: 53 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,63 @@ VIRTUALENV=$(shell echo "$${VDIR:-'.env'}")

all: $(VIRTUALENV)

$(VIRTUALENV): requirements.txt
@virtualenv --no-site-packages $(VIRTUALENV)
@$(VIRTUALENV)/bin/pip install -M -r requirements.txt
touch $(VIRTUALENV)

.PHONY: help
# target: help - Display callable targets
help:
@egrep "^# target:" [Mm]akefile

.PHONY: clean
# target: clean - Display callable targets
# target: clean - Clean repo
clean:
@rm -rf build dist docs/_build
@rm -f *.py[co]
@rm -f *.orig
@rm -f */*.py[co]
@rm -f */*.orig
find $(CURDIR)/$(MODULE) -name "*.pyc" -delete
find $(CURDIR)/$(MODULE) -name "*.orig" -delete
find $(CURDIR)/$(MODULE) -name "__pycache__" -delete


# ==============
# Bump version
# ==============

.PHONY: release
VERSION?=minor
# target: release - Bump version
release:
@pip install bumpversion
@bumpversion $(VERSION)
@git checkout master
@git merge develop
@git checkout develop
@git push --all
@git push --tags

.PHONY: minor
minor: release

.PHONY: patch
patch:
make release VERSION=patch

.PHONY: major
major:
make release VERSION=major


# ===============
# Build package
# ===============

.PHONY: register
# target: register - Register module on PyPi
register:
@python setup.py register

.PHONY: sdist
sdist:
@python setup.py sdist

.PHONY: upload
# target: upload - Upload module on PyPi
upload: docs
@pip install wheel
@python setup.py sdist upload || echo 'Already uploaded'
@python setup.py bdist_wheel upload || echo 'Already uploaded'
upload: clean docs
@pip install twine wheel
@python setup.py sdist bdist_wheel
@twine upload dist/*

.PHONY: docs
# target: docs - Compile and upload docs
Expand All @@ -48,12 +71,23 @@ docs:
@python setup.py build_sphinx --source-dir=docs/ --build-dir=docs/_build --all-files
@python setup.py upload_sphinx --upload-dir=docs/_build/html


# =============
# Development
# =============


$(VIRTUALENV): requirements.txt
[ -d $(VIRTUALENV) ] || @virtualenv --no-site-packages $(VIRTUALENV)
@$(VIRTUALENV)/bin/pip install -M -r requirements.txt
touch $(VIRTUALENV)

.PHONY: t
# target: t - Runs tests
t: clean
$(VIRTUALENV)/bin/python setup.py test

$(CURDIR)/example/db.sqlite3:
$(CURDIR)/example/db.sqlite3: $(VIRTUALENV)
$(VIRTUALENV)/bin/python example/manage.py syncdb --noinput

.PHONY: run
Expand Down

0 comments on commit 721e089

Please sign in to comment.