1- # Makefile.rules version 1.0 (2017-12-19 )
1+ # Makefile.rules version 1.1 (2017-12-20 )
22#
33# Helpful Makefile rules for releasing Python packages.
4+ # https://github.com/mgedmin/python-project-skel
45
56# You might want to change these
67FILE_WITH_VERSION ?= setup.py
@@ -10,15 +11,18 @@ CHANGELOG_FORMAT ?= $(changelog_ver) ($(changelog_date))
1011
1112# These should be fine
1213PYTHON ?= python
13- PYPI_PUBLISH ?= rm -rf dist && $(PYTHON ) setup.py -q sdist bdist_wheel && twine upload dist/* && $( VCS_TAG ) ` $( PYTHON ) setup.py --version `
14+ PYPI_PUBLISH ?= rm -rf dist && $(PYTHON ) setup.py -q sdist bdist_wheel && twine upload dist/*
1415
1516# These should be fine, as long as you use Git
1617VCS_GET_LATEST ?= git pull
1718VCS_STATUS ?= git status --porcelain
1819VCS_EXPORT ?= git archive --format=tar --prefix=tmp/tree/ HEAD | tar -xf -
19- VCS_TAG ?= git tag -s
20+ VCS_TAG ?= git tag -s $( changelog_ver ) -m \"Release $( changelog_ver ) \"
2021VCS_COMMIT_AND_PUSH ?= git commit -av -m "Post-release version bump" && git push && git push --tags
2122
23+ # These are internal implementation details
24+ changelog_ver = ` $( PYTHON) setup.py --version`
25+ changelog_date = ` LC_ALL=C date +' $(CHANGELOG_DATE_FORMAT)' `
2226
2327
2428.PHONY : dist
@@ -81,9 +85,6 @@ check-version-number:
8185check-long-description :
8286 @$(PYTHON ) setup.py --long-description | rst2html --exit-status=2 > /dev/null
8387
84- changelog_ver = ` $( PYTHON) setup.py --version`
85- changelog_date = ` LC_ALL=C date +' $(CHANGELOG_DATE_FORMAT)' `
86-
8788.PHONY : check-changelog
8889check-changelog :
8990 @ver_and_date=" $( CHANGELOG_FORMAT) " && \
@@ -106,6 +107,7 @@ define release_recipe =
106107 @echo "Please run"
107108 @echo
108109 @echo " $(PYPI_PUBLISH ) "
110+ @echo " $(VCS_TAG ) "
109111 @echo
110112 @echo "Please increment the version number in $(FILE_WITH_VERSION ) "
111113 @echo "and add a new empty entry at the top of the changelog in $(FILE_WITH_CHANGELOG ) , then"
0 commit comments