From cfb735ca383e71d7da293ee5ce0673920a3325bf Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 3 Nov 2023 15:19:58 +0000 Subject: [PATCH] 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 --- openstack_releases/pythonutils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openstack_releases/pythonutils.py b/openstack_releases/pythonutils.py index cf0db81890..4aa75b9c36 100644 --- a/openstack_releases/pythonutils.py +++ b/openstack_releases/pythonutils.py @@ -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')