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 8d0023d commit a368f99
Showing 1 changed file with 7 additions and 55 deletions.
62 changes: 7 additions & 55 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@
# Or you may want to select an explicit Python version, e.g. python2.7
PYTHON = python

# Directory that will be nuked and created for stuff
TMPDIR = tmp

#
# Bit of an implementation detail: all scripts generated by buildout
#
scripts = bin/test bin/python bin/zodbbrowser

# my cargo-culted release rules
# my release rules
FILE_WITH_VERSION = src/zodbbrowser/__init__.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


#
Expand All @@ -46,62 +39,21 @@ testp: bin/test
coverage:
tox -e coverage

.PHONY: dist
dist:
$(PYTHON) setup.py -q sdist bdist_wheel

.PHONY: checkzope2
checkzope2: dist python/bin/python
version=`$(PYTHON) setup.py --version` && \
rm -rf $(TMPDIR) && \
mkdir $(TMPDIR) && \
cd $(TMPDIR) && \
rm -rf tmp && \
mkdir tmp && \
cd tmp && \
tar xvzf ../dist/zodbbrowser-$$version.tar.gz && \
cd zodbbrowser-$$version && \
../../python/bin/python bootstrap.py && \
bin/buildout -c zope2.cfg && \
bin/test -s zodbbrowser

.PHONY: distcheck
distcheck: check dist
version=`$(PYTHON) setup.py --version` && \
rm -rf $(TMPDIR) && \
mkdir $(TMPDIR) && \
cd $(TMPDIR) && \
tar xvzf ../dist/zodbbrowser-$$version.tar.gz && \
cd zodbbrowser-$$version && \
make dist && \
cd .. && \
mkdir one two && \
cd one && \
tar xvzf ../../dist/zodbbrowser-$$version.tar.gz && \
cd ../two/ && \
tar xvzf ../zodbbrowser-$$version/dist/zodbbrowser-$$version.tar.gz && \
cd .. && \
diff -ur one two -x SOURCES.txt && \
cd .. && \
rm -rf $(TMPDIR) && \
echo "sdist seems to be ok"
# I'm ignoring SOURCES.txt since it appears that the second sdist gets a new
# source file, namely, setup.cfg. Setuptools/distutils black magic, may it rot
# in hell forever.

release:
@$(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 || { \
echo "There's a ReStructuredText error in the package description"; exit 1; }
@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; }
@test -z "`$(VCS_STATUS) 2>&1`" || { echo "Your working tree is not clean:" 1>&2; $(VCS_STATUS) 1>&2; exit 1; }
make distcheck
# I'm chicken so I won't actually do these things yet
@echo "Please run rm -rf dist && $(PYTHON) setup.py -q sdist bdist_wheel && twine upload dist/*"
@echo "Please run $(VCS_TAG) `$(PYTHON) setup.py --version`"
@echo "Please increment the version number in $(FILE_WITH_VERSION)"
@echo "Please add a new empty entry in $(FILE_WITH_CHANGELOG)"
@echo "Then please $(VCS_COMMIT_AND_PUSH)"

include release.mk


#
# Implementation
Expand Down

0 comments on commit a368f99

Please sign in to comment.