Skip to content

Commit dd8ee4f

Browse files
committed
Start fixing venv test fixture pip toml bug
This is not yet a usable fix, because venv.create only supports upgrade_deps on Python 3.9 and higher.
1 parent d40e7d0 commit dd8ee4f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/lib/helper.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,13 @@ class VirtualEnvironment:
403403

404404
__slots__ = ("_env_dir",)
405405

406-
def __init__(self, env_dir, *, with_pip):
406+
def __init__(self, env_dir, *, need_pip):
407407
if os.name == "nt":
408408
self._env_dir = osp.realpath(env_dir)
409-
venv.create(self.env_dir, symlinks=False, with_pip=with_pip)
409+
venv.create(self.env_dir, symlinks=False, with_pip=need_pip, upgrade_deps=need_pip)
410410
else:
411411
self._env_dir = env_dir
412-
venv.create(self.env_dir, symlinks=True, with_pip=with_pip)
412+
venv.create(self.env_dir, symlinks=True, with_pip=need_pip, upgrade_deps=need_pip)
413413

414414
@property
415415
def env_dir(self):

test/test_index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ def test_hook_uses_shell_not_from_cwd(self, rw_dir, case):
10601060
# from a venv may not run when copied outside of it, and a global interpreter
10611061
# won't run when copied to a different location if it was installed from the
10621062
# Microsoft Store. So we make a new venv in rw_dir and use its interpreter.
1063-
venv = VirtualEnvironment(rw_dir, with_pip=False)
1063+
venv = VirtualEnvironment(rw_dir, need_pip=False)
10641064
shutil.copy(venv.python, Path(rw_dir, shell_name))
10651065
shutil.copy(fixture_path("polyglot"), hook_path("polyglot", repo.git_dir))
10661066
payload = Path(rw_dir, "payload.txt")

test/test_installation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_installation(self, rw_dir):
6464

6565
@staticmethod
6666
def _set_up_venv(rw_dir):
67-
venv = VirtualEnvironment(rw_dir, with_pip=True)
67+
venv = VirtualEnvironment(rw_dir, need_pip=True)
6868
os.symlink(
6969
os.path.dirname(os.path.dirname(__file__)),
7070
venv.sources,

0 commit comments

Comments
 (0)