Skip to content

Commit db974ea

Browse files
authored
Merge pull request #443 from stonebig/master
support complex wheel names
2 parents 956d813 + c24e58a commit db974ea

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

winpython/data/packages.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ description=IDLE Extensions for Python
349349
[idna]
350350
description=Internationalized Domain Names in Applications (IDNA)
351351

352+
[imageio]
353+
description=Library for reading and writing a wide range of image, video, scientific, and volumetric data formats.
354+
352355
[imagesize]
353356
description=Getting image size from png/jpeg/jpeg2000/gif file
354357

winpython/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ def extract_archive(fname, targetdir=None, verbose=False):
483483

484484
def get_source_package_infos(fname):
485485
"""Return a tuple (name, version) of the Python source package"""
486-
match = re.match(SOURCE_PATTERN, osp.basename(fname).replace("+mkl-","-"))
486+
if fname[-4:] == '.whl':
487+
return osp.basename(fname).split("-")[:2]
488+
match = re.match(SOURCE_PATTERN, osp.basename(fname))
487489
if match is not None:
488490
return match.groups()[:2]
489491

winpython/wppm.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,13 @@ def extract_infos(self):
140140
return
141141
# New : Binary wheel case
142142
elif bname.endswith(('32.whl', '64.whl')):
143-
match = re.match(utils.WHEELBIN_PATTERN, bname)
144-
# typical match is ('scipy', '0.14.1rc1', '34', 'win32')
145-
if match is not None:
146-
self.name, self.version, self.pywheel , arch = match.groups()
147-
# self.pywheel version is '34' not 3.4
148-
self.pyversion = self.pywheel[:1] + '.' + self.pywheel[1:]
149-
# wheel arch is 'win32' or 'win_amd64'
150-
self.architecture = 32 if arch == 'win32' else 64
151-
return
143+
# {name}-{version}-{python tag}-{abi tag}-{platform tag}.whl
144+
# ['sounddevice','0.3.5','py2.py3.cp34.cp35','none','win32']
145+
self.name, self.version, self.pywheel, abi, arch = bname[:-4].split("-")
146+
self.pyversion = None # Let's ignore this self.pywheel
147+
# wheel arch is 'win32' or 'win_amd64'
148+
self.architecture = 32 if arch == 'win32' else 64
149+
return
152150
elif bname.endswith(('.zip', '.tar.gz', '.whl')):
153151
# distutils sdist
154152
infos = utils.get_source_package_infos(bname)
@@ -359,7 +357,7 @@ def get_installed_packages(self):
359357

360358
# create pip package list
361359
wppip = [Package('%s-%s-py2.py3-none-any.whl' %
362-
(i[0].lower(), i[1])) for i in pip_list]
360+
(i[0].replace('-', '_').lower(), i[1])) for i in pip_list]
363361
# pip package version is supposed better
364362
already = set(b.name.replace('-', '_') for b in wppip+wininst)
365363
wppm = wppip + [i for i in wppm

0 commit comments

Comments
 (0)