Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Dec 19, 2017
1 parent 6b45f72 commit ede41f8
Showing 1 changed file with 1 addition and 59 deletions.
60 changes: 1 addition & 59 deletions Makefile
Expand Up @@ -2,10 +2,6 @@ PYTHON := python

FILE_WITH_VERSION := setup.py
FILE_WITH_CHANGELOG := CHANGES.rst
VCS_STATUS := git status --porcelain
VCS_EXPORT := git archive --format=tar --prefix=tmp/tree/ HEAD | tar -xf -
VCS_TAG := git tag
VCS_COMMIT_AND_PUSH := git commit -av -m "Post-release version bump" && git push && git push --tags


.PHONY: all
Expand All @@ -30,59 +26,5 @@ smoketest-coverage:
bin/coverage run -a --source=mgp2pdf.py -m mgp2pdf --unsafe -o /tmp/ samples/*/*.mgp -v > /dev/null
bin/coverage report

.PHONY: dist
dist:
$(PYTHON) setup.py sdist

.PHONY: distcheck
distcheck:
# Bit of a chicken-and-egg here, but if the tree is unclean, make
# distcheck will fail.
ifndef FORCE
@test -z "`$(VCS_STATUS) 2>&1`" || { echo; echo "Your working tree is not clean" 1>&2; $(VCS_STATUS); exit 1; }
endif
make dist
pkg_and_version=`$(PYTHON) setup.py --name`-`$(PYTHON) setup.py --version` && \
rm -rf tmp && \
mkdir tmp && \
$(VCS_EXPORT) && \
cd tmp && \
tar xvzf ../dist/$$pkg_and_version.tar.gz && \
diff -ur $$pkg_and_version tree -x PKG-INFO -x setup.cfg -x '*.egg-info' -x samples -x 'samples/*' && \
cd $$pkg_and_version && \
make dist check && \
cd .. && \
mkdir one two && \
cd one && \
tar xvzf ../../dist/$$pkg_and_version.tar.gz && \
cd ../two/ && \
tar xvzf ../$$pkg_and_version/dist/$$pkg_and_version.tar.gz && \
cd .. && \
diff -ur one two -x SOURCES.txt -x samples -x 'samples/*' && \
cd .. && \
rm -rf tmp && \
echo "sdist seems to be ok"

.PHONY: releasechecklist
releasechecklist:
@$(PYTHON) setup.py --version | grep -qv dev || { \
echo "Please remove the 'dev' suffix from the version number in $(FILE_WITH_VERSION)"; exit 1; }
@$(PYTHON) setup.py --long-description | rst2html --exit-status=2 > /dev/null
@ver_and_date="`$(PYTHON) setup.py --version` (`date +%Y-%m-%d`)" && \
grep -q "^$$ver_and_date$$" $(FILE_WITH_CHANGELOG) || { \
echo "$(FILE_WITH_CHANGELOG) has no entry for $$ver_and_date"; exit 1; }
make distcheck

.PHONY: release
release: releasechecklist
# I'm chicken so I won't actually do these things yet
@echo "Please run"
@echo
@echo " rm -rf dist && $(PYTHON) setup.py sdist bdist_wheel && twine upload dist/* && $(VCS_TAG) `$(PYTHON) setup.py --version`"
@echo
@echo "Please increment the version number in $(FILE_WITH_VERSION)"
@echo "and add a new empty entry at the top of the changelog in $(FILE_WITH_CHANGELOG), then"
@echo
@echo ' $(VCS_COMMIT_AND_PUSH)'
@echo

include release.mk

0 comments on commit ede41f8

Please sign in to comment.