def test_upgrade_dependencies(self):
builder = venv.EnvBuilder()
bin_path = 'Scripts' if sys.platform == 'win32' else 'bin'
- pip_exe = 'pip.exe' if sys.platform == 'win32' else 'pip'
+ python_exe = 'python.exe' if sys.platform == 'win32' else 'python'
with tempfile.TemporaryDirectory() as fake_env_dir:
def pip_cmd_checker(cmd):
self.assertEqual(
cmd,
[
- os.path.join(fake_env_dir, bin_path, pip_exe),
+ os.path.join(fake_env_dir, bin_path, python_exe),
+ '-m',
+ 'pip',
'install',
- '-U',
+ '--upgrade',
'pip',
'setuptools'
]
f'Upgrading {CORE_VENV_DEPS} packages in {context.bin_path}'
)
if sys.platform == 'win32':
- pip_exe = os.path.join(context.bin_path, 'pip.exe')
+ python_exe = os.path.join(context.bin_path, 'python.exe')
else:
- pip_exe = os.path.join(context.bin_path, 'pip')
- cmd = [pip_exe, 'install', '-U']
+ python_exe = os.path.join(context.bin_path, 'python')
+ cmd = [python_exe, '-m', 'pip', 'install', '--upgrade']
cmd.extend(CORE_VENV_DEPS)
subprocess.check_call(cmd)