Skip to content

Commit cf47320

Browse files
committed
1 parent f7f71de commit cf47320

1 file changed

Lines changed: 10 additions & 49 deletions

File tree

Makefile

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ PYTHON = python
22

33
FILE_WITH_VERSION = objgraph.py
44
FILE_WITH_CHANGELOG = CHANGES.rst
5-
VCS_STATUS = git status --porcelain
6-
VCS_EXPORT = git archive --format=tar --prefix=tmp/tree/ HEAD | tar -xf -
5+
76
VCS_DIFF_IMAGES = git diff docs/*.png
8-
VCS_TAG = git tag
9-
VCS_COMMIT_AND_PUSH = git commit -av -m "Post-release version bump" && git push && git push --tags
107

118
SUPPORTED_PYTHON_VERSIONS = 2.7 3.3 3.4 3.5 3.6
129

@@ -54,7 +51,7 @@ test-all-pythons:
5451
.PHONY: preview-pypi-description
5552
preview-pypi-description:
5653
# pip install restview, if missing
57-
restview -e "$(PYTHON) setup.py --long-description"
54+
restview --long-description
5855

5956
.PHONY: coverage
6057
coverage:
@@ -67,47 +64,6 @@ lint:
6764
flake8 --exclude=build,docs/conf.py --ignore=E226
6865
flake8 --exclude=build,docs/conf.py --doctests --ignore=E226,F821
6966

70-
.PHONY: dist
71-
dist:
72-
$(PYTHON) setup.py -q sdist
73-
74-
.PHONY: distcheck
75-
distcheck:
76-
# Bit of a chicken-and-egg here, but if the tree is unclean, make
77-
# distcheck will fail.
78-
@test -z "`$(VCS_STATUS) 2>&1`" || { echo; echo "Your working tree is not clean" 1>&2; $(VCS_STATUS); exit 1; }
79-
make dist
80-
pkg_and_version=`$(PYTHON) setup.py --name`-`$(PYTHON) setup.py --version` && \
81-
rm -rf tmp && \
82-
mkdir tmp && \
83-
$(VCS_EXPORT) && \
84-
cd tmp && \
85-
tar xvzf ../dist/$$pkg_and_version.tar.gz && \
86-
diff -ur $$pkg_and_version tree -x PKG-INFO -x setup.cfg -x '*.egg-info' && \
87-
cd $$pkg_and_version && \
88-
make dist check && \
89-
cd .. && \
90-
mkdir one two && \
91-
cd one && \
92-
tar xvzf ../../dist/$$pkg_and_version.tar.gz && \
93-
cd ../two/ && \
94-
tar xvzf ../$$pkg_and_version/dist/$$pkg_and_version.tar.gz && \
95-
cd .. && \
96-
diff -ur one two -x SOURCES.txt && \
97-
cd .. && \
98-
rm -rf tmp && \
99-
echo "sdist seems to be ok"
100-
101-
.PHONY: releasechecklist
102-
releasechecklist:
103-
@$(PYTHON) setup.py --version | grep -qv dev || { \
104-
echo "Please remove the 'dev' suffix from the version number in $(FILE_WITH_VERSION)"; exit 1; }
105-
@$(PYTHON) setup.py --long-description | rst2html --exit-status=2 > /dev/null
106-
@ver_and_date="`$(PYTHON) setup.py --version` (`date +%Y-%m-%d`)" && \
107-
grep -q "^$$ver_and_date$$" $(FILE_WITH_CHANGELOG) || { \
108-
echo "$(FILE_WITH_CHANGELOG) has no entry for $$ver_and_date"; exit 1; }
109-
make distcheck
110-
11167
# Make sure $(VCS_DIFF_IMAGES) can work
11268
.PHONY: config-imgdiff
11369
config-imgdiff:
@@ -117,8 +73,12 @@ config-imgdiff:
11773
imgdiff: config-imgdiff
11874
$(VCS_DIFF_IMAGES)
11975

120-
.PHONY: release
121-
release: releasechecklist config-imgdiff
76+
include release.mk
77+
78+
.PHONY: do-release
79+
do-release: config-imgdiff
80+
81+
define release_recipe =
12282
# I'm chicken so I won't actually do these things yet
12383
@echo "It is a good idea to run"
12484
@echo
@@ -131,14 +91,15 @@ release: releasechecklist config-imgdiff
13191
@echo
13292
@echo "then either revert or commit the new images and run"
13393
@echo
134-
@echo " rm -rf dist && $(PYTHON) setup.py sdist bdist_wheel && twine upload dist/* && $(VCS_TAG) `$(PYTHON) setup.py --version`"
94+
@echo " $(PYPI_PUBLISH)"
13595
@echo " make publish-docs"
13696
@echo
13797
@echo "Please increment the version number in $(FILE_WITH_VERSION)"
13898
@echo "and add a new empty entry at the top of the changelog in $(FILE_WITH_CHANGELOG), then"
13999
@echo
140100
@echo ' $(VCS_COMMIT_AND_PUSH)'
141101
@echo
102+
endef
142103

143104
.PHONY: publish-docs
144105
publish-docs:

0 commit comments

Comments
 (0)