@@ -108,7 +108,6 @@ def get_env(name, current=True):
108108 break
109109
110110
111-
112111def set_env (name , value , current = True ):
113112 """Set HKCU/HKLM environment variables"""
114113 root = winreg .HKEY_CURRENT_USER if current else winreg .HKEY_LOCAL_MACHINE
@@ -275,7 +274,7 @@ def get_python_infos(path):
275274
276275
277276def 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
279278 *path*"""
280279 ver = python_query ("import sys; print('%d.%d.%d' % "
281280 "(sys.version_info.major, sys.version_info.minor,"
@@ -284,6 +283,7 @@ def get_python_long_version(path):
284283 ver = None
285284 return ver
286285
286+
287287# =============================================================================
288288# Patch chebang line (courtesy of Christoph Gohlke)
289289# =============================================================================
@@ -324,7 +324,7 @@ def patch_sourcefile(fname, in_text, out_text, silent_mode=False):
324324 new_content = content .replace (in_text , out_text )
325325 if not new_content == content :
326326 if not silent_mode :
327- print ("patching " , fname , "from" , in_text , "to" , out_text )
327+ print ("patching " , fname , "from" , in_text , "to" , out_text )
328328 with io .open (fname , 'wt' ) as fh :
329329 fh .write (new_content )
330330
@@ -352,12 +352,13 @@ def extract_msi(fname, targetdir=None, verbose=False):
352352 args += ['/qn' ]
353353 args += ['TARGETDIR=%s' % targetdir ]
354354 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 )
357357 # ensure pip if it's not 3.3
358358 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' )))
361362 # We patch ensurepip live (shame) !!!!
362363 # rational: https://github.com/pypa/pip/issues/2328
363364 import glob
@@ -442,7 +443,7 @@ def build_wininst(root, python_exe=None, copy_to=None,
442443 archstr = 'win32' if architecture == 32 else 'win-amd64'
443444 cmd += ['--plat-name=%s' % archstr ]
444445 cmd += [installer ]
445- # root = a tmp dir in windows\tmp,
446+ # root = a tmp dir in windows\tmp,
446447 if verbose :
447448 subprocess .call (cmd , cwd = root )
448449 else :
@@ -468,13 +469,13 @@ def build_wininst(root, python_exe=None, copy_to=None,
468469 # for wheels (winpython here)
469470 match = re .match (SOURCE_PATTERN , distname )
470471 if match is not None :
471- break
472+ break
472473 match = re .match (WHEELBIN_PATTERN , distname )
473474 if match is not None :
474475 break
475476 else :
476477 raise RuntimeError ("Build failed: not a pure Python package? %s" %
477- distdir )
478+ distdir )
478479 src_fname = osp .join (distdir , distname )
479480 if copy_to is None :
480481 return src_fname
@@ -507,7 +508,7 @@ def build_wheel(this_whl, python_exe=None, copy_to=None,
507508 assert osp .isfile (python_exe )
508509 myroot = os .path .dirname (python_exe )
509510
510- #cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
511+ # cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
511512 cmd = [python_exe , '-m' , 'pip' , 'install' ]
512513 if install_options :
513514 cmd += install_options # typically ['--no-deps']
@@ -539,14 +540,14 @@ def do_script(this_script, python_exe=None, copy_to=None,
539540 assert osp .isfile (python_exe )
540541 myroot = os .path .dirname (python_exe )
541542
542- #cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
543+ # cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
543544 cmd = [python_exe ]
544545 if install_options :
545546 cmd += install_options # typically ['--no-deps']
546547 print ('script install_options' , install_options )
547548 cmd += [this_script ]
548- # print('build_wheel', myroot, cmd)
549- print ("Executing " , cmd )
549+ # print('build_wheel', myroot, cmd)
550+ print ("Executing " , cmd )
550551
551552 if verbose :
552553 subprocess .call (cmd , cwd = myroot )
@@ -559,7 +560,8 @@ def do_script(this_script, python_exe=None, copy_to=None,
559560 if verbose :
560561 print ("Executed " % cmd )
561562 return 'ok'
562-
563+
564+
563565def wheel_to_wininst (fname , python_exe = None ,
564566 architecture = None , verbose = False , install_options = None ):
565567 """Just install a wheel !"""
0 commit comments