|
32 | 32 | from .utils import (
|
33 | 33 | convert_deps_from_pip, convert_deps_to_pip, is_required_version,
|
34 | 34 | proper_case, pep423_name, split_vcs, resolve_deps, shellquote, is_vcs,
|
35 |
| - python_version, suggest_package, is_file |
| 35 | + python_version, suggest_package, find_windows_executable, is_file |
36 | 36 | )
|
37 | 37 | from .__version__ import __version__
|
38 | 38 | from . import pep508checker, progress
|
@@ -1136,10 +1136,6 @@ def pip_install(
|
1136 | 1136 | no_deps=True, verbose=False, block=True
|
1137 | 1137 | ):
|
1138 | 1138 |
|
1139 |
| - # Block is always true on windows, for there be bugs. |
1140 |
| - if os.name == 'nt': |
1141 |
| - block=True |
1142 |
| - |
1143 | 1139 | # Create files for hash mode.
|
1144 | 1140 | if (not ignore_hashes) and (r is None):
|
1145 | 1141 | r = tempfile.mkstemp(prefix='pipenv-', suffix='-requirement.txt')[1]
|
@@ -1173,8 +1169,12 @@ def pip_install(
|
1173 | 1169 |
|
1174 | 1170 | no_deps = '--no-deps' if no_deps else ''
|
1175 | 1171 |
|
1176 |
| - pip_command = '"{0}" install {3} {1} -i {2} --exists-action w'.format( |
1177 |
| - which_pip(allow_global=allow_global), |
| 1172 | + quoted_pip = which_pip(allow_global=allow_global) |
| 1173 | + if os.name != 'nt': |
| 1174 | + quoted_pip = shellquote(quoted_pip) |
| 1175 | + |
| 1176 | + pip_command = '{0} install {3} {1} -i {2} --exists-action w'.format( |
| 1177 | + quoted_pip, |
1178 | 1178 | install_reqs,
|
1179 | 1179 | source['url'],
|
1180 | 1180 | no_deps
|
@@ -1211,10 +1211,7 @@ def which(command, location=None, allow_global=False):
|
1211 | 1211 |
|
1212 | 1212 | if not allow_global:
|
1213 | 1213 | if os.name == 'nt':
|
1214 |
| - if command.endswith('.py'): |
1215 |
| - p = os.sep.join([location] + ['Scripts\{0}'.format(command)]) |
1216 |
| - else: |
1217 |
| - p = os.sep.join([location] + ['Scripts\{0}.exe'.format(command)]) |
| 1214 | + p = find_windows_executable(os.path.join(location, 'Scripts'), command) |
1218 | 1215 | else:
|
1219 | 1216 | p = os.sep.join([location] + ['bin/{0}'.format(command)])
|
1220 | 1217 | else:
|
|
0 commit comments