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.
This commit is contained in:
Lumir Balhar 2020-07-21 15:20:12 +02:00
parent 5561755a00
commit cb8e334272
2 changed files with 3 additions and 2 deletions

View File

@ -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}}" %{?*}
}

View File

@ -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,