summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2019-03-18 12:43:38 -0700
committerGitHub <noreply@github.com>2019-03-18 12:43:38 -0700
commit5ba7063f4fa2818681275b5237fe7e416d45f98b (patch)
tree9b4db88bd8b66c81595b8468e4272c2510c96044 /Makefile
parentbaf255e4c17676e53b594f1b6d4258983bfe5b09 (diff)
downloadansible-5ba7063f4fa2818681275b5237fe7e416d45f98b.tar.gz
Build manpages as part of sdist (#53728)
* Build fixups This is in pursuit of making snapshots easier. * Allow overriding the python command used for generating man pages * Build the changelog prior to creating the sdist * Add the uninstalled ansible library to PYTHONPATH for changelog generation * Warn that python setup.py sdist may be incomplete; use make sdist or make snapshot instead. * Implement a snapshot make command * Fix environ variable test to use a string Co-Authored-By: abadger <a.badger@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 54eb2dc5ca..e775e15171 100644
--- a/Makefile
+++ b/Makefile
@@ -31,9 +31,10 @@ ASCII2MAN = rst2man.py $< $@
else
ASCII2MAN = @echo "ERROR: rst2man from docutils command is not installed but is required to build $(MANPAGES)" && exit 1
endif
-GENERATE_CLI = docs/bin/generate_man.py
PYTHON=python
+GENERATE_CLI = $(PYTHON) docs/bin/generate_man.py
+
SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
# fetch version from project release.py as single source-of-truth
@@ -238,7 +239,14 @@ sdist_check:
.PHONY: sdist
sdist: sdist_check clean docs
- $(PYTHON) setup.py sdist
+ _ANSIBLE_SDIST_FROM_MAKEFILE=1 $(PYTHON) setup.py sdist
+
+# Official releases generate the changelog as the last commit before the release.
+# Snapshots shouldn't result in new checkins so the changelog is generated as
+# part of creating the tarball.
+.PHONY: snapshot
+sdist: sdist_check clean docs changelog
+ _ANSIBLE_SDIST_FROM_MAKEFILE=1 $(PYTHON) setup.py sdist
.PHONY: sdist_upload
sdist_upload: clean docs
@@ -246,7 +254,7 @@ sdist_upload: clean docs
.PHONY: changelog
changelog:
- packaging/release/changelogs/changelog.py release -vv && packaging/release/changelogs/changelog.py generate -vv
+ PYTHONPATH=./lib packaging/release/changelogs/changelog.py release -vv && PYTHONPATH=./lib packaging/release/changelogs/changelog.py generate -vv
.PHONY: rpmcommon
rpmcommon: sdist