From cb8e334272a6fd6d3417ca0d0b3899482be4942e Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 21 Jul 2020 15:20:12 +0200 Subject: [PATCH] Use python -m tox instead of just tox This way, macros can use whatever Python has tox module available instead of only the main one which owns /usr/bin/tox. --- macros.pyproject | 2 +- pyproject_buildrequires.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/macros.pyproject b/macros.pyproject index 737a856..aa787f6 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -92,5 +92,5 @@ TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \\ PATH="%{buildroot}%{_bindir}:$PATH" \\ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \\ HOSTNAME="rpmbuild" \\ -tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*} +%{__python3} -m tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*} } diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index 4efcdee..49b1cde 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -219,7 +219,8 @@ def generate_tox_requirements(toxenv, requirements): requirements.check(source='tox itself') with tempfile.NamedTemporaryFile('r') as depfile: r = subprocess.run( - ['tox', '--print-deps-to-file', depfile.name, '-qre', toxenv], + [sys.executable, '-m', 'tox', '--print-deps-to-file', + depfile.name, '-qre', toxenv], check=False, encoding='utf-8', stdout=subprocess.PIPE,