Add conditional dependencies (when creating source distributions).
352439
def get_install_requires():
    """"""
    install_requires = get_requirements('requirements.txt')
    if 'bdist_wheel' not in sys.argv:
        if sys.version_info[0] == 2:
            # On Python 2.6 and 2.7 we pull in Bazaar.
            install_requires.append('bzr >= 2.6.0')
        if sys.version_info[2:] == (2, 6):
            # On Python 2.6 we have to stick to versions of Mercurial below 4.3
            # because 4.3 drops support for Python 2.6, see the change log:
            # https://www.mercurial-scm.org/wiki/WhatsNew
            install_requires.append('mercurial >= 2.9, < 4.3')
        elif (2, 6) < sys.version_info[:2] < (3, 0):
            # On Python 2.7 we pull in Mercurial.
            install_requires.append('mercurial >= 2.9')
    return sorted(install_requires)
181903
public function addDependency($dep)
    {
        if (is_array($dep)) {
            $this->dependencies = array_merge($this->dependencies, $dep);
        } else {
            $this->dependencies[] = $dep;
        }
    }
1083548
def depends (self, d):
        
        self.dependencies_ = unique (self.dependencies_ + d).sort ()
134953
def get_dependencies(self):
    """"""
    producer_infos = set()
    for product_type in self._dependencies:
      producer_infos.update(self._get_producer_infos_by_product_type(product_type))
    return producer_infos
995681
def get_dependants(project_name):
    """"""
    for package in get_installed_distributions(user_only=ENABLE_USER_SITE):
        if is_dependant(package, project_name):
            yield package.project_name
682694
def depends_on(self, dependency):
        
        packages = self.package_info()
        return [package for package in packages if dependency in package.get("requires", "")]
447724
def dependencies(source):
    """"""
    loader = ClassLoader(source, max_cache=-1)
    all_dependencies = set()
    for klass in loader.classes:
        new_dependencies = loader.dependencies(klass) - all_dependencies
        all_dependencies.update(new_dependencies)
        for new_dep in new_dependencies:
            click.echo(new_dep)
1353935
def install(self, dependency):
        """"""
        if not self.pip_installed:
            logger.info("Need to install a dependency with pip, but no builtin, "
                        "doing it manually (just wait a little, all should go well)")
            self._brute_force_install_pip()

        # split to pass several tokens on multiword dependency (this is very specific for '-e' on
        # external requirements, but implemented generically; note that this does not apply for
        # normal reqs, because even if it originally is 'foo > 1.2', after parsing it loses the
        # internal spaces)
        str_dep = str(dependency)
        args = [self.pip_exe, "install"] + str_dep.split()

        if self.options:
            for option in self.options:
                args.extend(option.split())
        logger.info("Installing dependency: %r", str_dep)
        try:
            helpers.logged_exec(args)
        except helpers.ExecutionError as error:
            error.dump_to_log(logger)
            raise error
        except Exception as error:
            logger.exception("Error installing %s: %s", str_dep, error)
            raise error
905903
public void addDependency(final Dependency dependency) {
        if(dependency != null && !dependencies.contains(dependency)){
            this.dependencies.add(dependency);
        }
    }
299858
def gather_sources_and_dependencies(globs, base_dir=None):
    """"""

    experiment_path, main = get_main_file(globs)

    base_dir = base_dir or experiment_path

    gather_sources = source_discovery_strategies[SETTINGS['DISCOVER_SOURCES']]
    sources = gather_sources(globs, base_dir)
    if main is not None:
        sources.add(main)

    gather_dependencies = dependency_discovery_strategies[
        SETTINGS['DISCOVER_DEPENDENCIES']]
    dependencies = gather_dependencies(globs, base_dir)

    if opt.has_numpy:
        # Add numpy as a dependency because it might be used for randomness
        dependencies.add(PackageDependency.create(opt.np))

    return main, sources, dependencies
494415
def ensure_packages(packages):
    """"""
    required = filter_installed_packages(packages)
    if required:
        apt_install(required, fatal=True)
1260352
def add_ppas_from_file(file_name, update=True):
    """"""

    for ppa in _read_lines_from_file(file_name):
        add_ppa(ppa, update=False)
    if update:
        update_apt_sources()
38469
def build_distributions(context):
    """"""
    rmtree('dist', ignore_errors=True)

    build_package_command = 'python setup.py clean sdist bdist_wheel'
    result = shell.dry_run(build_package_command, context.dry_run)
    packages = Path('dist').files() if not context.dry_run else "nothing"

    if not result:
        raise Exception('Error building packages: %s' % result)
    else:
        log.info('Built %s' % ', '.join(packages))
    return packages
1181248
def command_dependants(options):
    """"""
    dependants = sorted(
        get_dependants(options.package.project_name),
        key=lambda n: n.lower()
    )

    if dependants:
        print(*dependants, sep='\n')
1115465
def command_dependents(options):
    """"""
    dependents = dependencies(options.package, options.recursive, options.info)

    if dependents:
        print(*dependents, sep='\n')
140622
def set_dependencies(analysis, dependencies, path):
    

    for toc in (analysis.binaries, analysis.datas):
        for i, tpl in enumerate(toc):
            if not tpl[1] in dependencies.keys():
                logger.info("Adding dependency %s located in %s" % (tpl[1], path))
                dependencies[tpl[1]] = path
            else:
                dep_path = get_relative_path(path, dependencies[tpl[1]])
                logger.info("Referencing %s to be a dependecy for %s, located in %s" % (tpl[1], path, dep_path))
                analysis.dependencies.append((":".join((dep_path, tpl[0])), tpl[1], "DEPENDENCY"))
                toc[i] = (None, None, None)
        # Clean the list
        toc[:] = [tpl for tpl in toc if tpl != (None, None, None)]
632095
def add_dependency(self, name, obj):
        """"""

        if name in self._deps:
            if self._deps[name] is obj:
                return
            raise ValueError(
                "There exists a different dep with the same name : %r" % name)
        self._deps[name] = obj