tox: Do not concat stdout and stderr in getting siblings

Several packages in calling "python setup.py --name ..." may return
warning message, e.g.:

  ...
  _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
  !!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************

  !!
  dist.fetch_build_eggs(dist.setup_requires)
  WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
  <PACKAGE_NAME>

and then this huge log places into the package_name variable. But
script expects that package_name will contain only package name. Because of this situation could not find siblings packages and
install them.

Change-Id: I5bf9a19233c48d1260b5ab17d749bfc58a8ef2fa
This commit is contained in:
Roman Kuznecov 2023-11-16 14:36:53 +00:00
parent 3b3495e255
commit 6710f84a90

View File

@ -109,8 +109,7 @@ def get_sibling_python_packages(projects, tox_python):
# package name is. # package name is.
package_name = subprocess.check_output( package_name = subprocess.check_output(
[os.path.abspath(tox_python), 'setup.py', '--name'], [os.path.abspath(tox_python), 'setup.py', '--name'],
cwd=os.path.abspath(root), cwd=os.path.abspath(root)).decode('utf-8')
stderr=subprocess.STDOUT).decode('utf-8')
if package_name: if package_name:
package_name = package_name.strip() package_name = package_name.strip()
packages[package_name] = root packages[package_name] = root