Run an sdist before the bdist_wheel command

The hook sequencing doesn't work as well for bdist_wheel as it does for
sdist because bdist_wheel creates a build destination before setup hooks
run, but the setup hooks get run the context of the source dir, so that
the content gets generated but not in the right location.

sdist does not do a build directory, so by running an sdist first,
we cause setup hooks to get run in the correct context and before the
bdist_wheel step gets run. This means when bdist_wheel gets run, the
results of any setup hooks will be appropriately in place.

Change-Id: I5ca72b9cebcb27d7ab7b44198a98f7a8287de0b3
This commit is contained in:
Monty Taylor 2018-10-12 13:46:43 -05:00
parent f899ba2170
commit f2a47fea64
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 5 additions and 1 deletions

View File

@ -229,7 +229,11 @@ def build(args):
# Build a wheel so that we have an install target.
# pip install . in the container context with the mounted
# source dir gets ... exciting.
cont.run("python setup.py bdist_wheel -d /root/.cache/pip")
# We run sdist first to trigger code generation steps such
# as are found in zuul, since the sequencing otherwise
# happens in a way that makes wheel content copying unhappy.
cont.run(
"python setup.py sdist bdist_wheel -d /root/.cache/pip")
# Install with all container-related extras so that we populate
# the wheel cache as needed.