Fix tests with virtualenv 20.31+

This commit is contained in:
Miro Hrončok 2025-05-12 18:27:24 +02:00
commit 6b3221eebd
3 changed files with 85 additions and 9 deletions

View file

@ -31,6 +31,9 @@ Source: %{pypi_source tox}
# Support Python 3.14.0b1
Patch: https://github.com/tox-dev/tox/pull/3524.patch
# Fix using deprecated virtualenv option --wheel
Patch: https://github.com/tox-dev/tox/pull/3528.patch
# Remove dependency on devpi-process.
# Remove dependency on detect-test-pollution.
# Remove coverage-related dependencies.
@ -130,6 +133,12 @@ export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}"
%if %{with tests}
%check
# Upstream requires virtualenv >= 20.31 for tests, and no longer sets VIRTUALENV_WHEEL.
# To support environments with older virtualenv, we set it manually:
%if v"%(%{python3} -c 'import importlib.metadata as im; print(im.version("virtualenv"))' 2>/dev/null || echo 0)" < v"20.31"
export VIRTUALENV_WHEEL=bundle
%endif
# Skipped tests use internal virtualenv functionality to
# download wheels which does not work with "bundled" version of wheel in
# the Fedora's virtualenv patch.