Beispiel #1
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith('.exe'):
         # distutils bdist_wininst
         match = re.match(utils.WININST_PATTERN, bname)
         if match is not None:
             (self.name, self.version, _t0, _qtver, arch, _t1,
              self.pyversion, _t2) = match.groups()
             self.architecture = 32 if arch == 'win32' else 64
             return
         # NSIS
         pat = r'([a-zA-Z0-9\-\_]*)-Py([0-9\.]*)-x(64|32)-gpl-([0-9\.\-]*[a-z]*)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.pyversion, arch, self.version = match.groups()
             self.architecture = int(arch)
             return
         match = re.match(
             r'([a-zA-Z0-9\-\_]*)-([0-9\.]*[a-z]*)-py([0-9\.]*)-x(64|32)-([a-z0-9\.\-]*).exe',
             bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch, _pyqt = match.groups(
             )
             self.architecture = int(arch)
             return
     elif bname.endswith(('.zip', '.tar.gz')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError("Not supported package type %s" % bname)
Beispiel #2
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith(('32.whl', '64.whl')):
         # {name}[-{bloat}]-{version}-{python tag}-{abi tag}-{platform tag}.whl
         # ['sounddevice','0.3.5','py2.py3.cp34.cp35','none','win32']
         # PyQt5-5.7.1-5.7.1-cp34.cp35.cp36-none-win_amd64.whl
         bname2 = bname[:-4].split("-")
         self.name = bname2[0]
         self.version = '-'.join(list(bname2[1:-3]))
         self.pywheel, abi, arch = bname2[-3:]
         self.pyversion = (
             None
         )  # Let's ignore this  self.pywheel
         # wheel arch is 'win32' or 'win_amd64'
         self.architecture = (
             32 if arch == 'win32' else 64
         )
         return
     elif bname.endswith(('.zip', '.tar.gz', '.whl')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError(
         "Not supported package type %s" % bname
     )
Beispiel #3
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith('.exe'):
         # distutils bdist_wininst
         match = re.match(utils.WININST_PATTERN, bname)
         if match is not None:
             (self.name, self.version,
              _t0, _qtver, arch, _t1, self.pyversion, _t2) = match.groups()
             self.architecture = 32 if arch == 'win32' else 64
             return
         # NSIS
         pat = r'([a-zA-Z0-9\-\_]*)-Py([0-9\.]*)-x(64|32)-gpl-([0-9\.\-]*[a-z]*)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.pyversion, arch, self.version = match.groups()
             self.architecture = int(arch)
             return
         match = re.match(r'([a-zA-Z0-9\-\_]*)-([0-9\.]*[a-z]*)-py([0-9\.]*)-x(64|32)-([a-z0-9\.\-]*).exe', bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch, _pyqt = match.groups()
             self.architecture = int(arch)
             return
     elif bname.endswith(('.zip', '.tar.gz')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError("Not supported package type %s" % bname)
Beispiel #4
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith('.exe'):
         # distutils bdist_wininst
         match = re.match(utils.WININST_PATTERN, bname)
         if match is not None:
             (self.name, self.version, _t0, _qtver, arch, _t1,
              self.pyversion, _t2) = match.groups()
             self.architecture = 32 if arch == 'win32' else 64
             return
         # NSIS
         pat = r'([a-zA-Z0-9\-\_]*)-Py([0-9\.]*)-x(64|32)-gpl-([0-9\.\-]*[a-z]*)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.pyversion, arch, self.version = match.groups()
             self.architecture = int(arch)
             return
         # NSIS complement to match PyQt4-4.10.4-gpl-Py3.4-Qt4.8.6-x32.exe
         pat = r'([a-zA-Z0-9\_]*)-([0-9\.]*[a-z]*)-gpl-Py([0-9\.]*)-.*-x(64|32)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch = match.groups()
             self.architecture = int(arch)
             return
         match = re.match(
             r'([a-zA-Z0-9\-\_]*)-([0-9\.]*[a-z]*)-py([0-9\.]*)-x(64|32)-([a-z0-9\.\-]*).exe',
             bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch, _pyqt = match.groups(
             )
             self.architecture = int(arch)
             return
     # New : Binary wheel case
     elif bname.endswith(('32.whl', '64.whl')):
         # {name}[-{bloat}]-{version}-{python tag}-{abi tag}-{platform tag}.whl
         # ['sounddevice','0.3.5','py2.py3.cp34.cp35','none','win32']
         # PyQt5-5.7.1-5.7.1-cp34.cp35.cp36-none-win_amd64.whl
         bname2 = bname[:-4].split("-")
         self.name = bname2[0]
         self.version = '-'.join(list(bname2[1:-3]))
         self.pywheel, abi, arch = bname2[-3:]
         self.pyversion = None  # Let's ignore this  self.pywheel
         # wheel arch is 'win32' or 'win_amd64'
         self.architecture = 32 if arch == 'win32' else 64
         return
     elif bname.endswith(('.zip', '.tar.gz', '.whl')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError("Not supported package type %s" % bname)
Beispiel #5
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith('.exe'):
         # distutils bdist_wininst
         match = re.match(utils.WININST_PATTERN, bname)
         if match is not None:
             (self.name, self.version, _t0, _qtver, arch, _t1,
              self.pyversion, _t2) = match.groups()
             self.architecture = 32 if arch == 'win32' else 64
             return
         # NSIS
         pat = r'([a-zA-Z0-9\-\_]*)-Py([0-9\.]*)-x(64|32)-gpl-([0-9\.\-]*[a-z]*)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.pyversion, arch, self.version = match.groups()
             self.architecture = int(arch)
             return
         # NSIS complement to match PyQt4-4.10.4-gpl-Py3.4-Qt4.8.6-x32.exe
         pat = r'([a-zA-Z0-9\_]*)-([0-9\.]*[a-z]*)-gpl-Py([0-9\.]*)-.*-x(64|32)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch = match.groups()
             self.architecture = int(arch)
             return
         match = re.match(
             r'([a-zA-Z0-9\-\_]*)-([0-9\.]*[a-z]*)-py([0-9\.]*)-x(64|32)-([a-z0-9\.\-]*).exe',
             bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch, _pyqt = match.groups(
             )
             self.architecture = int(arch)
             return
     # New : Binary wheel case
     elif bname.endswith(('32.whl', '64.whl')):
         match = re.match(utils.WHEELBIN_PATTERN, bname)
         # typical match is ('scipy', '0.14.1rc1', '34', 'win32')
         if match is not None:
             self.name, self.version, self.pywheel, arch = match.groups()
             # self.pywheel version is '34' not 3.4
             self.pyversion = self.pywheel[:1] + '.' + self.pywheel[1:]
             # wheel arch is 'win32' or 'win_amd64'
             self.architecture = 32 if arch == 'win32' else 64
             return
     elif bname.endswith(('.zip', '.tar.gz', '.whl')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError("Not supported package type %s" % bname)
Beispiel #6
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith('.exe'):
         # distutils bdist_wininst
         match = re.match(utils.WININST_PATTERN, bname)
         if match is not None:
             (self.name, self.version, _t0, _qtver, arch, _t1,
              self.pyversion, _t2) = match.groups()
             self.architecture = 32 if arch == 'win32' else 64
             return
         # NSIS
         pat = r'([a-zA-Z0-9\-\_]*)-Py([0-9\.]*)-x(64|32)-gpl-([0-9\.\-]*[a-z]*)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.pyversion, arch, self.version = match.groups()
             self.architecture = int(arch)
             return
         # NSIS complement to match PyQt4-4.10.4-gpl-Py3.4-Qt4.8.6-x32.exe
         pat = r'([a-zA-Z0-9\_]*)-([0-9\.]*[a-z]*)-gpl-Py([0-9\.]*)-.*-x(64|32)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch = match.groups()
             self.architecture = int(arch)
             return
         match = re.match(
             r'([a-zA-Z0-9\-\_]*)-([0-9\.]*[a-z]*)-py([0-9\.]*)-x(64|32)-([a-z0-9\.\-]*).exe',
             bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch, _pyqt = match.groups(
             )
             self.architecture = int(arch)
             return
     # New : Binary wheel case
     elif bname.endswith(('32.whl', '64.whl')):
         match = re.match(utils.WHEELBIN_PATTERN, bname)
         # typical match is ('scipy', '0.14.1rc1', '34', 'win32')
         if match is not None:
             self.name, self.version, self.pywheel, arch = match.groups()
             # self.pywheel version is '34' not 3.4
             self.pyversion = self.pywheel[:1] + '.' + self.pywheel[1:]
             # wheel arch is 'win32' or 'win_amd64'
             self.architecture = 32 if arch == 'win32' else 64
             return
     elif bname.endswith(('.zip', '.tar.gz', '.whl')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError("Not supported package type %s" % bname)
Beispiel #7
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith('.exe'):
         # distutils bdist_wininst
         match = re.match(utils.WININST_PATTERN, bname)
         if match is not None:
             (self.name, self.version,
              _t0, _qtver, arch, _t1, self.pyversion, _t2) = match.groups()
             self.architecture = 32 if arch == 'win32' else 64
             return
         # NSIS
         pat = r'([a-zA-Z0-9\-\_]*)-Py([0-9\.]*)-x(64|32)-gpl-([0-9\.\-]*[a-z]*)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.pyversion, arch, self.version = match.groups()
             self.architecture = int(arch)
             return
         # NSIS complement to match PyQt4-4.10.4-gpl-Py3.4-Qt4.8.6-x32.exe
         pat = r'([a-zA-Z0-9\_]*)-([0-9\.]*[a-z]*)-gpl-Py([0-9\.]*)-.*-x(64|32)\.exe'
         match = re.match(pat, bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch = match.groups()
             self.architecture = int(arch)
             return
         match = re.match(r'([a-zA-Z0-9\-\_]*)-([0-9\.]*[a-z]*)-py([0-9\.]*)-x(64|32)-([a-z0-9\.\-]*).exe', bname)
         if match is not None:
             self.name, self.version, self.pyversion, arch, _pyqt = match.groups()
             self.architecture = int(arch)
             return
     # New : Binary wheel case
     elif bname.endswith(('32.whl', '64.whl')):
         # {name}[-{bloat}]-{version}-{python tag}-{abi tag}-{platform tag}.whl 
         # ['sounddevice','0.3.5','py2.py3.cp34.cp35','none','win32'] 
         # PyQt5-5.7.1-5.7.1-cp34.cp35.cp36-none-win_amd64.whl
         bname2 = bname[:-4].split("-")             
         self.name = bname2[0]
         self.version = '-'.join(list(bname2[1:-3]))
         self.pywheel, abi, arch = bname2[-3:]
         self.pyversion = None # Let's ignore this  self.pywheel
         # wheel arch is 'win32' or 'win_amd64'
         self.architecture = 32 if arch == 'win32' else 64
         return
     elif bname.endswith(('.zip', '.tar.gz', '.whl')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError("Not supported package type %s" % bname)
Beispiel #8
0
 def extract_infos(self):
     """Extract package infos (name, version, architecture)
     from filename (installer basename)"""
     bname = osp.basename(self.fname)
     if bname.endswith(('32.whl', '64.whl')):
         # {name}[-{bloat}]-{version}-{python tag}-{abi tag}-{platform tag}.whl 
         # ['sounddevice','0.3.5','py2.py3.cp34.cp35','none','win32'] 
         # PyQt5-5.7.1-5.7.1-cp34.cp35.cp36-none-win_amd64.whl
         bname2 = bname[:-4].split("-")             
         self.name = bname2[0]
         self.version = '-'.join(list(bname2[1:-3]))
         self.pywheel, abi, arch = bname2[-3:]
         self.pyversion = None # Let's ignore this  self.pywheel
         # wheel arch is 'win32' or 'win_amd64'
         self.architecture = 32 if arch == 'win32' else 64
         return
     elif bname.endswith(('.zip', '.tar.gz', '.whl')):
         # distutils sdist
         infos = utils.get_source_package_infos(bname)
         if infos is not None:
             self.name, self.version = infos
             return
     raise NotImplementedError("Not supported package type %s" % bname)