@@ -108,7 +108,6 @@ def get_env(name, current=True):
108
108
break
109
109
110
110
111
-
112
111
def set_env (name , value , current = True ):
113
112
"""Set HKCU/HKLM environment variables"""
114
113
root = winreg .HKEY_CURRENT_USER if current else winreg .HKEY_LOCAL_MACHINE
@@ -275,7 +274,7 @@ def get_python_infos(path):
275
274
276
275
277
276
def get_python_long_version (path ):
278
- """Return long version (X.Y.Z) for the Python distribution located in
277
+ """Return long version (X.Y.Z) for the Python distribution located in
279
278
*path*"""
280
279
ver = python_query ("import sys; print('%d.%d.%d' % "
281
280
"(sys.version_info.major, sys.version_info.minor,"
@@ -284,6 +283,7 @@ def get_python_long_version(path):
284
283
ver = None
285
284
return ver
286
285
286
+
287
287
# =============================================================================
288
288
# Patch chebang line (courtesy of Christoph Gohlke)
289
289
# =============================================================================
@@ -324,7 +324,7 @@ def patch_sourcefile(fname, in_text, out_text, silent_mode=False):
324
324
new_content = content .replace (in_text , out_text )
325
325
if not new_content == content :
326
326
if not silent_mode :
327
- print ("patching " , fname , "from" , in_text , "to" , out_text )
327
+ print ("patching " , fname , "from" , in_text , "to" , out_text )
328
328
with io .open (fname , 'wt' ) as fh :
329
329
fh .write (new_content )
330
330
@@ -352,12 +352,13 @@ def extract_msi(fname, targetdir=None, verbose=False):
352
352
args += ['/qn' ]
353
353
args += ['TARGETDIR=%s' % targetdir ]
354
354
subprocess .call ([extract ]+ args , cwd = osp .dirname (fname ))
355
- print ('fname=%s' % fname )
356
- print ('TARGETDIR=%s' % targetdir )
355
+ print ('fname=%s' % fname )
356
+ print ('TARGETDIR=%s' % targetdir )
357
357
# ensure pip if it's not 3.3
358
358
if '-3.3' not in targetdir :
359
- subprocess .call ([r'%s\%s' % (targetdir , 'python.exe' ), '-m' , 'ensurepip' ],
360
- cwd = osp .dirname (r'%s\%s' % (targetdir , 'pythons.exe' )))
359
+ subprocess .call (
360
+ [r'%s\%s' % (targetdir , 'python.exe' ), '-m' , 'ensurepip' ],
361
+ cwd = osp .dirname (r'%s\%s' % (targetdir , 'pythons.exe' )))
361
362
# We patch ensurepip live (shame) !!!!
362
363
# rational: https://github.com/pypa/pip/issues/2328
363
364
import glob
@@ -442,7 +443,7 @@ def build_wininst(root, python_exe=None, copy_to=None,
442
443
archstr = 'win32' if architecture == 32 else 'win-amd64'
443
444
cmd += ['--plat-name=%s' % archstr ]
444
445
cmd += [installer ]
445
- # root = a tmp dir in windows\tmp,
446
+ # root = a tmp dir in windows\tmp,
446
447
if verbose :
447
448
subprocess .call (cmd , cwd = root )
448
449
else :
@@ -468,13 +469,13 @@ def build_wininst(root, python_exe=None, copy_to=None,
468
469
# for wheels (winpython here)
469
470
match = re .match (SOURCE_PATTERN , distname )
470
471
if match is not None :
471
- break
472
+ break
472
473
match = re .match (WHEELBIN_PATTERN , distname )
473
474
if match is not None :
474
475
break
475
476
else :
476
477
raise RuntimeError ("Build failed: not a pure Python package? %s" %
477
- distdir )
478
+ distdir )
478
479
src_fname = osp .join (distdir , distname )
479
480
if copy_to is None :
480
481
return src_fname
@@ -507,7 +508,7 @@ def build_wheel(this_whl, python_exe=None, copy_to=None,
507
508
assert osp .isfile (python_exe )
508
509
myroot = os .path .dirname (python_exe )
509
510
510
- #cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
511
+ # cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
511
512
cmd = [python_exe , '-m' , 'pip' , 'install' ]
512
513
if install_options :
513
514
cmd += install_options # typically ['--no-deps']
@@ -539,14 +540,14 @@ def do_script(this_script, python_exe=None, copy_to=None,
539
540
assert osp .isfile (python_exe )
540
541
myroot = os .path .dirname (python_exe )
541
542
542
- #cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
543
+ # cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
543
544
cmd = [python_exe ]
544
545
if install_options :
545
546
cmd += install_options # typically ['--no-deps']
546
547
print ('script install_options' , install_options )
547
548
cmd += [this_script ]
548
- # print('build_wheel', myroot, cmd)
549
- print ("Executing " , cmd )
549
+ # print('build_wheel', myroot, cmd)
550
+ print ("Executing " , cmd )
550
551
551
552
if verbose :
552
553
subprocess .call (cmd , cwd = myroot )
@@ -559,7 +560,8 @@ def do_script(this_script, python_exe=None, copy_to=None,
559
560
if verbose :
560
561
print ("Executed " % cmd )
561
562
return 'ok'
562
-
563
+
564
+
563
565
def wheel_to_wininst (fname , python_exe = None ,
564
566
architecture = None , verbose = False , install_options = None ):
565
567
"""Just install a wheel !"""
0 commit comments