Speed up sdist build
We have a couple validations that need to build an sdist now. But once it has been built in our temporary pristine clone, we don't need to build it again. Because we create a clean clone, we also don't need to worry about any stale dist builds. This adds a check to the sdist build logic to recognize if an sdist has already been built and skip it. There are also a few extra steps in the build process that are not needed for our purposes. The biggest is the new(ish) pbr behavior of building all release notes in the git tree if reno is present. This adds an environment variable flag to tell pbr not to do that. While we're at it, we don't need AUTHORS or CHANGELOG created either, so set the flags telling pbr to skip those as well. Change-Id: I15be9a12ff6684729980c40afae9625a8b8e550a Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
b19a92adbe
commit
854d9e270b
@ -60,8 +60,14 @@ def get_sdist_name(workdir, repo):
|
||||
|
||||
|
||||
def build_sdist(workdir, repo):
|
||||
"Build the sdist."
|
||||
"""Build the sdist."""
|
||||
dest = os.path.join(workdir, repo)
|
||||
|
||||
build_path = os.path.join(dest, 'dist')
|
||||
if os.path.exists(build_path):
|
||||
# sdist already built, skip rebuilding it
|
||||
return
|
||||
|
||||
setup_path = os.path.join(dest, 'setup.py')
|
||||
if not os.path.exists(setup_path):
|
||||
LOG.debug('did not find %s, maybe %s is not a python project',
|
||||
@ -80,10 +86,17 @@ def build_sdist(workdir, repo):
|
||||
python = '.tox/venv/bin/python3'
|
||||
else:
|
||||
python = 'python3'
|
||||
# Run it once and discard the result to ensure any setup_requires
|
||||
# dependencies are installed.
|
||||
# Set some flags to turn off pbr functionality that we don't need
|
||||
flags = {
|
||||
'SKIP_GENERATE_RENO': '1',
|
||||
'SKIP_GENERATE_AUTHORS': '1',
|
||||
'SKIP_WRITE_GIT_CHANGELOG': '1',
|
||||
}
|
||||
cmd = [python, 'setup.py', 'sdist', 'bdist_wheel']
|
||||
processutils.check_call(cmd, cwd=dest)
|
||||
processutils.check_call(
|
||||
cmd,
|
||||
cwd=dest,
|
||||
env=flags)
|
||||
|
||||
|
||||
def check_readme_format(workdir, repo):
|
||||
|
Loading…
x
Reference in New Issue
Block a user