Ejemplo n.º 1
0
def main(args):
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--deps-file',
        '--deps_file',
        action='append',
        help='Path to deps.pyl file (may be used multiple times, '
        'default: bootstrap/deps.pyl)')
    parser.add_argument('-q',
                        '--quiet',
                        action='store_true',
                        default=False,
                        help='Supress all output')
    parser.add_argument('-r',
                        '--run-within-virtualenv',
                        action='store_true',
                        help='Run even if the script is being run within a '
                        'VirtualEnv.')
    parser.add_argument(
        'env_path',
        help='Path to place environment (default: %(default)s)',
        default='ENV')
    opts = parser.parse_args(args)
    opts.deps_file = opts.deps_file or [
        os.path.join(ROOT, 'bootstrap/deps.pyl')
    ]

    # Skip deps not available for this flavor of Python interpreter.
    #
    # Possible platform names:
    #   macosx_x86_64
    #   linux_i686
    #   linux_x86_64
    #   windows_i686
    #   windows_x86_64
    if sys.platform.startswith('linux'):
        osname = 'linux'
    elif sys.platform == 'darwin':
        osname = 'macosx'
    elif sys.platform == 'win32':
        osname = 'windows'
    else:
        osname = sys.platform
    if sys.maxsize == (2**31) - 1:
        bitness = 'i686'
    else:
        bitness = 'x86_64'
    plat = '%s_%s' % (osname, bitness)

    deps, kicked = filter_deps(merge_deps(opts.deps_file), plat)
    activate_env(opts.env_path, deps, opts.quiet, opts.run_within_virtualenv)

    if not opts.quiet and kicked:
        print '---------------------------'
        print 'WARNING! WARNING! WARNING! '
        print '---------------------------'
        print 'The following deps were skipped, they are not available on %s' % plat
        for pkg, dep in sorted(kicked.iteritems()):
            print '  * %s (%s)' % (pkg, dep['version'])
Ejemplo n.º 2
0
def main(args):
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--deps_file',
        action='append',
        help='Path to deps.pyl file (default: bootstrap/deps.pyl)')
    parser.add_argument(
        'to_build',
        nargs='*',
        help='Names of packages to build. Defaults to all packages.')
    opts = parser.parse_args(args)

    if 'Ubuntu' in platform_tag() and ROOT.startswith('/usr/local/'):
        print >> sys.stderr, "\n".join([
            "Due to a bug in Ubuntu's python distribution, build_deps.py does not",
            "work when run from under a path beginning with /usr/local/. Please ",
            "clone to a different path, and try again.", "",
            "Bug: https://github.com/pypa/virtualenv/issues/118"
        ])
        return 1

    deps_files = opts.deps_file or [os.path.join(ROOT, 'deps.pyl')]
    to_build = set(opts.to_build)

    build_env = os.path.join(ROOT, 'BUILD_ENV')

    print 'Parsing deps.pyl'
    deps = merge_deps(deps_files)
    bootstrap.activate_env(build_env, {'wheel': deps.pop('wheel')})

    print 'Finding missing deps'
    missing_deps = {}
    for name, entry in deps.iteritems():
        if to_build and name not in to_build:
            continue
        try:
            bootstrap.get_links({name: entry})
        except bootstrap.NoWheelException:
            missing_deps[name] = entry

    if not missing_deps:
        print 'Nothing to process'
        return

    print 'Processing deps:'
    print_deps(missing_deps)

    for name, options in missing_deps.iteritems():
        clear_wheelhouse()
        # TODO(iannucci):  skip entries which already exist in gs
        if 'repo' in options and 'rev' in options:
            process_git(name, options['rev'], options['build'],
                        options.get('build_options', ()), options['repo'])
        elif 'gs' in options:
            process_gs(name, options['gs'], options['build'],
                       options.get('build_options', ()))
        else:
            raise Exception('Invalid options %r for %r' % (options, name))
        push_wheelhouse()
Ejemplo n.º 3
0
def main(args):
  parser = argparse.ArgumentParser()
  parser.add_argument(
      '--deps_file', action='append',
      help='Path to deps.pyl file (default: bootstrap/deps.pyl)')
  parser.add_argument(
      'to_build', nargs='*',
      help='Names of packages to build. Defaults to all packages.')
  opts = parser.parse_args(args)

  if 'Ubuntu' in platform_tag() and ROOT.startswith('/usr/local/'):
    print >> sys.stderr, "\n".join([
      "Due to a bug in Ubuntu's python distribution, build_deps.py does not",
      "work when run from under a path beginning with /usr/local/. Please ",
      "clone to a different path, and try again.",
      "",
      "Bug: https://github.com/pypa/virtualenv/issues/118"
    ])
    return 1

  deps_files = opts.deps_file or [os.path.join(ROOT, 'deps.pyl')]
  to_build = set(opts.to_build)

  build_env = os.path.join(ROOT, 'BUILD_ENV')

  print 'Parsing deps.pyl'
  deps = merge_deps(deps_files)
  bootstrap.activate_env(build_env, {'wheel': deps.pop('wheel')})

  print 'Finding missing deps'
  missing_deps = {}
  for name, entry in deps.iteritems():
    if to_build and name not in to_build:
      continue
    try:
      bootstrap.get_links({name: entry})
    except bootstrap.NoWheelException:
      missing_deps[name] = entry

  if not missing_deps:
    print 'Nothing to process'
    return

  print 'Processing deps:'
  print_deps(missing_deps)

  for name, options in missing_deps.iteritems():
    clear_wheelhouse()
    # TODO(iannucci):  skip entries which already exist in gs
    if 'repo' in options and 'rev' in options:
      process_git(name, options['rev'], options['build'],
                  options.get('build_options', ()),
                  options['repo'])
    elif 'gs' in options:
      process_gs(name, options['gs'], options['build'],
                 options.get('build_options', ()))
    else:
      raise Exception('Invalid options %r for %r' % (options, name))
    push_wheelhouse()
Ejemplo n.º 4
0
def main(args):
  parser = argparse.ArgumentParser()
  parser.add_argument('--deps-file', '--deps_file', action='append',
                      help='Path to deps.pyl file (may be used multiple times)')
  parser.add_argument('-q', '--quiet', action='store_true', default=False,
                      help='Supress all output')
  parser.add_argument('env_path',
                      help='Path to place environment (default: %(default)s)',
                      default='ENV')
  opts = parser.parse_args(args)

  deps = merge_deps(opts.deps_file)
  activate_env(opts.env_path, deps, opts.quiet)
Ejemplo n.º 5
0
def main(args):
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--deps-file',
        '--deps_file',
        action='append',
        help='Path to deps.pyl file (may be used multiple times)')
    parser.add_argument('-q',
                        '--quiet',
                        action='store_true',
                        default=False,
                        help='Supress all output')
    parser.add_argument(
        'env_path',
        help='Path to place environment (default: %(default)s)',
        default='ENV')
    opts = parser.parse_args(args)

    deps = merge_deps(opts.deps_file)
    activate_env(opts.env_path, deps, opts.quiet)