Skip to content

Commit 2960549

Browse files
authored
Merge pull request #1399 from pre-commit/upgrade_pip_on_windows
Allow pip to be upgradable on windows
2 parents 171fd18 + 522e82b commit 2960549

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pre_commit/languages/python.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ def install_environment(
182182
version: str,
183183
additional_dependencies: Sequence[str],
184184
) -> None:
185-
additional_dependencies = tuple(additional_dependencies)
186185
directory = helpers.environment_dir(_dir, version)
186+
install = ('python', '-mpip', 'install', '.', *additional_dependencies)
187187

188188
env_dir = prefix.path(directory)
189189
with clean_path_on_failure(env_dir):
@@ -193,9 +193,7 @@ def install_environment(
193193
python = os.path.realpath(sys.executable)
194194
_make_venv(env_dir, python)
195195
with in_env(prefix, version):
196-
helpers.run_setup_cmd(
197-
prefix, ('pip', 'install', '.') + additional_dependencies,
198-
)
196+
helpers.run_setup_cmd(prefix, install)
199197

200198
return in_env, healthy, run_hook, install_environment
201199

0 commit comments

Comments
 (0)