From 8ff939d4daedd9c36e4eb3fe805681d1d6c5e220 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 5 May 2025 13:02:43 -0400 Subject: [PATCH] tests: remove no-wheel based on virtualenv version Signed-off-by: Henry Schreiner --- tests/conftest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 6981e48f8..db9eda952 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,10 +22,13 @@ import pytest from packaging.requirements import Requirement +from packaging.version import Version DIR = Path(__file__).parent.resolve() BASE = DIR.parent +VIRTUALENV_VERSION = Version(metadata.version("virtualenv")) + @pytest.fixture(scope="session") def pep518_wheelhouse(tmp_path_factory: pytest.TempPathFactory) -> Path: @@ -78,7 +81,9 @@ def pep518_wheelhouse(tmp_path_factory: pytest.TempPathFactory) -> Path: class VEnv: def __init__(self, env_dir: Path, *, wheelhouse: Path | None = None) -> None: - cmd = [str(env_dir), "--no-setuptools", "--no-wheel", "--activators", ""] + cmd = [str(env_dir), "--no-setuptools", "--activators", ""] + if Version("20.31.0") > VIRTUALENV_VERSION: + cmd.append("--no-wheel") result = _virtualenv.cli_run(cmd, setup_logging=False) self.wheelhouse = wheelhouse self.executable = Path(result.creator.exe)