@@ -381,14 +381,15 @@ def uninstall_existing(self, package):
381
381
if pack is not None :
382
382
self .uninstall (pack )
383
383
384
- def patch_all_shebang (self , to_movable = True , max_exe_size = 999999 ):
384
+ def patch_all_shebang (self , to_movable = True , max_exe_size = 999999 , targetdir = "" ):
385
385
"""make all python launchers relatives"""
386
386
import glob
387
387
import os
388
388
for ffname in glob .glob (r'%s\Scripts\*.exe' % self .target ):
389
389
size = os .path .getsize (ffname )
390
390
if size <= max_exe_size :
391
- utils .patch_shebang_line (ffname , to_movable = to_movable )
391
+ utils .patch_shebang_line (ffname , to_movable = to_movable ,
392
+ targetdir = targetdir )
392
393
393
394
394
395
def install (self , package , install_options = None ):
@@ -459,17 +460,18 @@ def patch_standard_packages(self, package_name='', to_movable=True):
459
460
# rational: https://github.com/pypa/pip/issues/2328
460
461
if package_name .lower () == "pip" or package_name == '' :
461
462
# ensure pip will create movable launchers
462
- # sheb_mov1 = old way up to WinPython 2016-01, sheb_mov2 = new way
463
+ # sheb_mov1 = classic way up to WinPython 2016-01
464
+ # sheb_mov2 = tried way, but doesn't work for pip (at least)
463
465
sheb_fix = " executable = get_executable()"
464
466
sheb_mov1 = " executable = os.path.join(os.path.basename(get_executable()))"
465
467
sheb_mov2 = " executable = os.path.join('..',os.path.basename(get_executable()))"
466
468
if to_movable :
467
469
utils .patch_sourcefile (self .target +
468
470
r"\Lib\site-packages\pip\_vendor\distlib\scripts.py" ,
469
- sheb_fix , sheb_mov2 )
471
+ sheb_fix , sheb_mov1 )
470
472
utils .patch_sourcefile (self .target +
471
473
r"\Lib\site-packages\pip\_vendor\distlib\scripts.py" ,
472
- sheb_mov1 , sheb_mov2 )
474
+ sheb_mov2 , sheb_mov1 )
473
475
else :
474
476
utils .patch_sourcefile (self .target +
475
477
r"\Lib\site-packages\pip\_vendor\distlib\scripts.py" ,
@@ -479,6 +481,7 @@ def patch_standard_packages(self, package_name='', to_movable=True):
479
481
sheb_mov2 , sheb_fix )
480
482
481
483
# ensure pip wheel will register relative PATH in 'RECORD' files
484
+ # will be in standard pip 8.0.3
482
485
utils .patch_sourcefile (
483
486
self .target + (
484
487
r"\Lib\site-packages\pip\wheel.py" ),
0 commit comments