Skip to content

Commit cdfff3e

Browse files
authored
tests: remove no-wheel based on virtualenv version (#1071)
See pypa/virtualenv#2868. It looks easy to check the virtualenv version, so let's just do that. Signed-off-by: Henry Schreiner <[email protected]>
1 parent cea3206 commit cdfff3e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222

2323
import pytest
2424
from packaging.requirements import Requirement
25+
from packaging.version import Version
2526

2627
DIR = Path(__file__).parent.resolve()
2728
BASE = DIR.parent
2829

30+
VIRTUALENV_VERSION = Version(metadata.version("virtualenv"))
31+
2932

3033
@pytest.fixture(scope="session")
3134
def pep518_wheelhouse(tmp_path_factory: pytest.TempPathFactory) -> Path:
@@ -78,7 +81,9 @@ def pep518_wheelhouse(tmp_path_factory: pytest.TempPathFactory) -> Path:
7881

7982
class VEnv:
8083
def __init__(self, env_dir: Path, *, wheelhouse: Path | None = None) -> None:
81-
cmd = [str(env_dir), "--no-setuptools", "--no-wheel", "--activators", ""]
84+
cmd = [str(env_dir), "--no-setuptools", "--activators", ""]
85+
if Version("20.31.0") > VIRTUALENV_VERSION:
86+
cmd.append("--no-wheel")
8287
result = _virtualenv.cli_run(cmd, setup_logging=False)
8388
self.wheelhouse = wheelhouse
8489
self.executable = Path(result.creator.exe)

0 commit comments

Comments
 (0)