Fix PBR name check with new tox

Changes to tox in the past year have rendered the PBR-specific
tweaks in get_sdist_name invalid, since calling tox from within tox
now creates testenv directories relative to the parent tox's working
directory rather than the child's. While we're here, turn on more
verbose logging in the tox invocation, and fix the subprocess
routine to not discard the command's output.

Change-Id: I35fb5dde9ec400397ed21035d57c3efb872d8e58
This commit is contained in:
Jeremy Stanley 2023-11-03 15:19:58 +00:00
parent f3298178a2
commit cfb735ca38
1 changed files with 4 additions and 4 deletions

View File

@ -40,18 +40,18 @@ def get_sdist_name(workdir, repo):
# Use tox to set up a virtualenv so we can install the
# dependencies for the package. This only seems to be
# necessary for pbr, but...
processutils.check_output(
['tox', '-e', 'venv', '--notest'],
processutils.check_call(
['tox', '-vv', 'devenv', '-c', 'tox.ini', 'pbrenv'],
cwd=dest,
)
if use_tox:
python = '.tox/venv/bin/python3'
python = 'pbrenv/bin/python3'
else:
python = 'python3'
# Run it once and discard the result to ensure any setup_requires
# dependencies are installed.
cmd = [python, 'setup.py', '--name']
processutils.check_output(cmd, cwd=dest)
processutils.check_call(cmd, cwd=dest)
# Run it again to get a clean version of the name.
LOG.debug('Running: %s in %s' % (' '.join(cmd), dest))
out = processutils.check_output(cmd, cwd=dest).decode('utf-8')