Skip to content

Commit 3b1f215

Browse files
author
stonebig
committed
cleanup code
1 parent 787063e commit 3b1f215

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

winpython/utils.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,11 @@ def source_to_wininst(fname, python_exe=None,
561561
architecture=architecture, verbose=verbose)
562562

563563

564-
def build_wheel(this_whl, python_exe=None, copy_to=None,
565-
architecture=None, verbose=False, install_options=None):
566-
"""Execute the wheel (without dependancies)"""
564+
def wheel_pip_install(fname, python_exe=None,
565+
architecture=None, verbose=False, install_options=None):
566+
"""direct install via pip !"""
567+
copy_to = osp.dirname(fname)
568+
567569
if python_exe is None:
568570
python_exe = sys.executable
569571
assert osp.isfile(python_exe)
@@ -574,7 +576,7 @@ def build_wheel(this_whl, python_exe=None, copy_to=None,
574576
if install_options:
575577
cmd += install_options # typically ['--no-deps']
576578
print('wheel install_options', install_options)
577-
cmd += [this_whl]
579+
cmd += [fname]
578580
# print('build_wheel', myroot, cmd)
579581

580582
if verbose:
@@ -586,12 +588,12 @@ def build_wheel(this_whl, python_exe=None, copy_to=None,
586588
the_log = ("%s" % stdout + "\n %s" % stderr)
587589

588590
if ' not find ' in the_log or ' not found ' in the_log:
589-
print("Failed to Install: \n %s \n" % this_whl)
591+
print("Failed to Install: \n %s \n" % fname)
590592
print("msg: %s" % the_log)
591593
raise RuntimeError
592594
p.stdout.close()
593595
p.stderr.close()
594-
src_fname = this_whl
596+
src_fname = fname
595597
if copy_to is None:
596598
return src_fname
597599
else:
@@ -629,15 +631,6 @@ def do_script(this_script, python_exe=None, copy_to=None,
629631
return 'ok'
630632

631633

632-
def wheel_to_wininst(fname, python_exe=None,
633-
architecture=None, verbose=False, install_options=None):
634-
"""Just install a wheel !"""
635-
return build_wheel(fname, python_exe=python_exe,
636-
copy_to=osp.dirname(fname),
637-
architecture=architecture, verbose=verbose,
638-
install_options=install_options)
639-
640-
641634
if __name__ == '__main__':
642635
gcc = get_gcc_version(osp.join(BASE_DIR, 'tools.win32', 'mingw32', 'bin'))
643636
print(("gcc version: %r" % gcc))

winpython/wppm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def extract_infos(self):
133133
# New : Binary wheel case
134134
elif bname.endswith(('32.whl', '64.whl')):
135135
match = re.match(utils.WHEELBIN_PATTERN, bname)
136-
# typical macht is ('scipy', '0.14.1rc1', '34', 'win32')
136+
# typical match is ('scipy', '0.14.1rc1', '34', 'win32')
137137
if match is not None:
138138
self.name, self.version, self.pywheel , arch = match.groups()
139139
# self.pywheel version is '34' not 3.4
@@ -558,7 +558,7 @@ def install_bdist_wheel(self, package, install_options=None):
558558
self._print(package, "Installing Wheel")
559559
# targetdir = utils.extract_msi(package.fname, targetdir=self.target)
560560
try:
561-
fname = utils.wheel_to_wininst(package.fname,
561+
fname = utils.wheel_pip_install(package.fname,
562562
python_exe=osp.join(self.target, 'python.exe'),
563563
architecture=self.architecture, verbose=self.verbose,
564564
install_options=install_options)

0 commit comments

Comments
 (0)