Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49cb48a

Browse filesBrowse files
authored
Merge pull request #1864 from EliahKagan/pip-toml
Use upgraded pip in test fixture virtual environment
2 parents d40e7d0 + a262a06 commit 49cb48a
Copy full SHA for 49cb48a

File tree

1 file changed

+9
-0
lines changed
Filter options

1 file changed

+9
-0
lines changed

‎test/lib/helper.py

Copy file name to clipboardExpand all lines: test/lib/helper.py
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import logging
1111
import os
1212
import os.path as osp
13+
import subprocess
14+
import sys
1315
import tempfile
1416
import textwrap
1517
import time
@@ -411,6 +413,13 @@ def __init__(self, env_dir, *, with_pip):
411413
self._env_dir = env_dir
412414
venv.create(self.env_dir, symlinks=True, with_pip=with_pip)
413415

416+
if with_pip:
417+
# The upgrade_deps parameter to venv.create is 3.9+ only, so do it this way.
418+
command = [self.python, "-m", "pip", "install", "--upgrade", "pip"]
419+
if sys.version_info < (3, 12):
420+
command.append("setuptools")
421+
subprocess.check_output(command)
422+
414423
@property
415424
def env_dir(self):
416425
"""The top-level directory of the environment."""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.