def bind_package(name, path=None, version_range=None, no_deps=False,
                 bind_args=None, quiet=False):
    """Bind software available on the current system, as a rez package.

    Note:
        `bind_args` is provided when software is bound via the 'rez-bind'
        command line tool. Bind modules can define their own command line
        options, and they will be present in `bind_args` if applicable.

    Args:
        name (str): Package name.
        path (str): Package path to install into; local packages path if None.
        version_range (`VersionRange`): If provided, only bind the software if
            it falls within this version range.
        no_deps (bool): If True, don't bind dependencies.
        bind_args (list of str): Command line options.
        quiet (bool): If True, suppress superfluous output.

    Returns:
        List of `Variant`: The variant(s) that were installed as a result of
        binding this package.
    """
    pending = set([name])
    installed_variants = []
    installed_package_names = set()
    primary = True

    # bind package and possibly dependencies
    while pending:
        pending_ = pending
        pending = set()
        exc_type = None

        for name_ in pending_:
            # turn error on binding of dependencies into a warning - we don't
            # want to skip binding some dependencies because others failed
            try:
                variants_ = _bind_package(name_,
                                          path=path,
                                          version_range=version_range,
                                          bind_args=bind_args,
                                          quiet=quiet)
            except exc_type as e:
                print_error("Could not bind '%s': %s: %s"
                            % (name_, e.__class__.__name__, str(e)))
                continue

            installed_variants.extend(variants_)

            for variant in variants_:
                installed_package_names.add(variant.name)

            # add dependencies
            if not no_deps:
                for variant in variants_:
                    for requirement in variant.requires:
                        if not requirement.conflict:
                            pending.add(requirement.name)

            # non-primary packages are treated a little differently
            primary = False
            version_range = None
            bind_args = None
            exc_type = RezBindError

    if installed_variants and not quiet:
        print "The following packages were installed:"
        print
        _print_package_list(installed_variants)

    return installed_variants
Bind software available on the current system, as a rez package.

    Note:
        `bind_args` is provided when software is bound via the 'rez-bind'
        command line tool. Bind modules can define their own command line
        options, and they will be present in `bind_args` if applicable.

    Args:
        name (str): Package name.
        path (str): Package path to install into; local packages path if None.
        version_range (`VersionRange`): If provided, only bind the software if
            it falls within this version range.
        no_deps (bool): If True, don't bind dependencies.
        bind_args (list of str): Command line options.
        quiet (bool): If True, suppress superfluous output.

    Returns:
        List of `Variant`: The variant(s) that were installed as a result of
        binding this package.