Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit 01865cf

Browse files
committed
ci: make it not complain about pip on windows
1 parent 90bcee7 commit 01865cf

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,15 @@ def normalise_python_location(self, pythons, k):
8181

8282
def make_venv(self, python_exe, version, errors):
8383
venv_location = self.made_venvs / f"venv{version}"
84+
created = False
8485
if not venv_location.exists():
86+
created = True
8587
PythonHandler().run_command(
8688
python_exe,
8789
f"""
8890
import json
8991
import venv
90-
venv.create({json.dumps(str(venv_location))}, with_pip=True)
92+
venv.create({json.dumps(str(venv_location))}, with_pip=False)
9193
""",
9294
)
9395

@@ -96,6 +98,9 @@ def make_venv(self, python_exe, version, errors):
9698
else:
9799
py = venv_location / "bin" / "python"
98100

101+
if created:
102+
subprocess.run([str(py), "-m", "ensurepip"], check=True)
103+
99104
if not py.exists():
100105
if errors:
101106
if venv_location.exists():

tests/test_creation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
describe "Finding the right version":
1010

11-
@pytest.mark.parametrize("version", [3.6, 3.7, 3.8, 3.9, "3.10"])
11+
@pytest.mark.parametrize("version", [3.7, 3.8, 3.9, "3.10"])
1212
it "will always use current version if no max is specified", version:
1313

1414
def script():
@@ -19,7 +19,7 @@ def script():
1919
with pytest.helpers.make_script(script, exe=exe, prepare_venv=True) as filename:
2020
pytest.helpers.assertPythonVersion(filename, str(version))
2121

22-
@pytest.mark.parametrize("version", [3.6, 3.7, 3.8, 3.9, "3.10"])
22+
@pytest.mark.parametrize("version", [3.7, 3.8, 3.9, "3.10"])
2323
it "will use the only version available if within min and max", version:
2424

2525
def script(version):

venvstarter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,14 +561,19 @@ def make_virtualenv(self):
561561
print(f"Using: {python_exe}", file=sys.stderr)
562562
print(file=sys.stderr)
563563

564+
with_pip = os.name != "nt"
565+
564566
PythonHandler().run_command(
565567
python_exe,
566568
f"""
567569
import venv
568-
venv.create({json.dumps(str(self.venv_location))}, with_pip=True, symlinks=True)
570+
venv.create({json.dumps(str(self.venv_location))}, with_pip={with_pip}, symlinks=True)
569571
""",
570572
)
571573

574+
if not with_pip:
575+
subprocess.run([str(self.venv_python), "-m", "ensurepip"], check=True)
576+
572577
return True
573578

574579
def check_deps(self):

0 commit comments

Comments
 (0)