Beispiel #1
0
 def package_exists(path):
     parsed_filename = WheelFile(path).parsed_filename
     package = parsed_filename.group('name')
     version = parsed_filename.group('ver')
     p = check_output('devpi list {}=={}'.format(package, version).split())
     exists = True if p else False
     if exists:
         print('Package {}={} already exists.'.format(package, version))
     return exists
Beispiel #2
0
    def package_exists(path):
        parsed_filename = WheelFile(path).parsed_filename
        package, version = parsed_filename.group(2), parsed_filename.group(4)
        try:
            p = check_output('devpi list {}=={}'.format(package,
                                                        version).split())
            exists = True if p else False
        except CalledProcessError as e:
            if '404 Not Found: no project' in e.stdout.decode('utf-8'):
                exists = False
            else:
                raise

        if exists:
            print('Package {}={} already exists.'.format(package, version))
        return exists