Print dependencies status
349179
def command_deps_status(self):
        
        image = ""
        for arg in self.args:
            if arg.startswith("--graph="):
                image = arg.split("=")[1]
        if len(self.args) == 1 and self.args[0] == "deps-status":
            DependenciesStatus(image).show()
        elif len(self.args) == 2 and self.args[0] == "deps-status" and image:
            DependenciesStatus(image).show()
        elif (len(self.args) == 2 and self.args[0] == "deps-status" and
                "--tree" in self.args):
            DependenciesStatus(image).tree()
        elif (len(self.args) == 3 and self.args[0] == "deps-status" and
                "--tree" in self.args and image):
            DependenciesStatus(image).tree()
        else:
            usage("")
694754
def check_dependencies(self):
        ""
        if self.test_program == 'nose':
            try:
                import nose
            except ImportError:
                sys.exit('Nosetests is not available on your system. Please install it and try to run it again')
        if self.test_program == 'py':
            try:
                import py
            except:
                sys.exit('py.test is not available on your system. Please install it and try to run it again')
        if self.test_program == 'django':
            try:
                import django
            except:
                sys.exit('django is not available on your system. Please install it and try to run it again')
        if self.test_program == 'phpunit':
            try:
                process = subprocess.check_call(['phpunit','--version']) 
            except:
                sys.exit('phpunit is not available on your system. Please install it and try to run it again')
        if self.test_program == 'tox':
            try:
                import tox
            except ImportError:
                sys.exit('tox is not available on your system. Please install it and try to run it again')
538418
def view(self):
        
        print("")   # new line at start
        conf_args = [
            "RELEASE",
            "SLACKWARE_VERSION",
            "COMP_ARCH",
            "BUILD_PATH",
            "PACKAGES",
            "PATCHES",
            "CHECKMD5",
            "DEL_ALL",
            "DEL_BUILD",
            "SBO_BUILD_LOG",
            "MAKEFLAGS",
            "DEFAULT_ANSWER",
            "REMOVE_DEPS_ANSWER",
            "SKIP_UNST",
            "RSL_DEPS",
            "DEL_DEPS",
            "USE_COLORS",
            "DOWNDER",
            "DOWNDER_OPTIONS",
            "SLACKPKG_LOG",
            "ONLY_INSTALLED",
            "PRG_BAR",
            "EDITOR",
            "NOT_DOWNGRADE"
        ]
        read_conf = Utils().read_file(self.config_file)
        for line in read_conf.splitlines():
            if not line.startswith("#") and line.split("=")[0] in conf_args:
                print("{0}".format(line))
            else:
                print("{0}{1}{2}".format(self.meta.color["CYAN"], line,
                                         self.meta.color["ENDC"]))
        print("")
734210
def CheckDependencies(verbose_output=True):
  
  print('Checking availability and versions of dependencies.')
  check_result = True

  for module_name, version_tuple in sorted(PYTHON_DEPENDENCIES.items()):
    if not _CheckPythonModule(
        module_name, version_tuple[0], version_tuple[1],
        is_required=version_tuple[3], maximum_version=version_tuple[2],
        verbose_output=verbose_output):
      check_result = False

  if not _CheckSQLite3(verbose_output=verbose_output):
    check_result = False

  if check_result and not verbose_output:
    print('[OK]')

  print('')
  return check_result
466239
def check_dependencies(dependencies, module):
    
    if type(dependencies) == str:
        dependencies = [dependencies]
    elif type(dependencies) != list:
        raise TypeError('dependencies argument must be of type list or string')

    for dependency in dependencies:
        if dependency not in settings.INSTALLED_APPS:
            raise DependencyError('%s depends on %s, which should be in settings.INSTALLED_APPS' % (module, dependency))
905511
function checkDependencies(req, res) {
                    var modelName = req.params.modelName,
                        id = req.params.documentId,
                        models = _.pluck(registry.models, 'model');

                    dependencies.check(models, modelName, id, function (err, depPair) {
                        if (err) throw err;
                        if (_.isEmpty(depPair)) return res.json(200, []);
                        var deps = depPair[1];
                        var lines = dependencies.depsToLines(deps);
                        return res.json(200, lines);
                    });
                }
413102
def summary(self):
        
        print("\nStatus summary")
        print("=" * 79)
        print("{0}found {1} dependencies in {2} packages.{3}\n".format(
            self.grey, self.count_dep, self.count_pkg, self.endc))
1105493
def _install_dependencies(self, ui, debug):
        """"""
        for dep_t, dep_l in self.dependencies:
            if not dep_l:
                continue
            pkg_mgr = self.get_package_manager(dep_t)
            pkg_mgr.works()
            to_resolve = []
            for dep in dep_l:
                if not pkg_mgr.is_pkg_installed(dep):
                    to_resolve.append(dep)
            if not to_resolve:
                # nothing to install, let's move on
                continue
            to_install = pkg_mgr.resolve(*to_resolve)
            confirm = self._ask_to_confirm(ui, pkg_mgr, *to_install)
            if not confirm:
                msg = 'List of packages denied by user, exiting.'
                raise exceptions.DependencyException(msg)

            type(self).install_lock = True
            # TODO: we should do this more systematically (send signal to cl/gui?)
            logger.info('Installing dependencies, sit back and relax ...',
                        extra={'event_type': 'dep_installation_start'})
            if ui == 'cli' and not debug:  # TODO: maybe let every manager to decide when to start
                event = threading.Event()
                t = EndlessProgressThread(event)
                t.start()
            installed = pkg_mgr.install(*to_install)
            if ui == 'cli' and not debug:
                event.set()
                t.join()
                if installed:
                    logger.info(' Done.')
                else:
                    logger.error(' Failed.')
            type(self).install_lock = False

            log_extra = {'event_type': 'dep_installation_end'}
            if not installed:
                msg = 'Failed to install dependencies, exiting.'
                logger.error(msg, extra=log_extra)
                raise exceptions.DependencyException(msg)
            else:
                logger.info('Successfully installed dependencies!', extra=log_extra)
742048
def dependencies_as_list(self):
        """"""
        dependencies = []
        for dependency in self.dependencies:
            dependencies.append(dependency.name)
        return dependencies
1356493
def status(ctx, client, revision, no_output, path):
    """"""
    graph = Graph(client)
    # TODO filter only paths = {graph.normalize_path(p) for p in path}
    status = graph.build_status(revision=revision, can_be_cwl=no_output)

    click.echo('On branch {0}'.format(client.repo.active_branch))
    if status['outdated']:
        click.echo(
            'Files generated from newer inputs:\n'
            '  (use "renku log [<file>...]" to see the full lineage)\n'
            '  (use "renku update [<file>...]" to '
            'generate the file from its latest inputs)\n'
        )

        for filepath, stts in sorted(status['outdated'].items()):
            outdated = (
                ', '.join(
                    '{0}#{1}'.format(
                        click.style(
                            graph._format_path(n.path), fg='blue', bold=True
                        ),
                        _format_sha1(graph, n),
                    ) for n in stts
                    if n.path and n.path not in status['outdated']
                )
            )

            click.echo(
                '\t{0}: {1}'.format(
                    click.style(
                        graph._format_path(filepath), fg='red', bold=True
                    ), outdated
                )
            )

        click.echo()

    else:
        click.secho(
            'All files were generated from the latest inputs.', fg='green'
        )

    if status['multiple-versions']:
        click.echo(
            'Input files used in different versions:\n'
            '  (use "renku log --revision <sha1> <file>" to see a lineage '
            'for the given revision)\n'
        )

        for filepath, files in sorted(status['multiple-versions'].items()):
            # Do not show duplicated commits!  (see #387)
            commits = {_format_sha1(graph, key) for key in files}
            click.echo(
                '\t{0}: {1}'.format(
                    click.style(
                        graph._format_path(filepath), fg='blue', bold=True
                    ), ', '.join(commits)
                )
            )

        click.echo()

    if status['deleted']:
        click.echo(
            'Deleted files used to generate outputs:\n'
            '  (use "git show <sha1>:<file>" to see the file content '
            'for the given revision)\n'
        )

        for filepath, node in status['deleted'].items():
            click.echo(
                '\t{0}: {1}'.format(
                    click.style(
                        graph._format_path(filepath), fg='blue', bold=True
                    ), _format_sha1(graph, node)
                )
            )

        click.echo()

    ctx.exit(1 if status['outdated'] else 0)
285480
def check_status(self):
        """"""
        # Recompute the status of the tasks
        # Ignore OK and LOCKED tasks.
        for task in self:
            if task.status in (task.S_OK, task.S_LOCKED): continue
            task.check_status()

        # Take into account possible dependencies. Use a list instead of generators
        for task in self:
            if task.status == task.S_LOCKED: continue
            if task.status < task.S_SUB and all(status == task.S_OK for status in task.deps_status):
                task.set_status(task.S_READY, "Status set to Ready")
1230862
def verify_dependencies(self):
        

        for i in range(1, len(self.deps)):
            assert(not (isinstance(self.deps[i], Transformation) and
                   isinstance(self.deps[i - 1], Analysis))
                   ), "invalid dep order for %s" % self
522351
def check_dependencies():
    
    available = []
    try:
        shell('ebook-convert')
        available.append('calibre')
    except OSError:
        pass
    try:
        shell('pandoc --help')
        available.append('pandoc')
    except OSError:
        pass
    if not available:
        sys.exit(error('No generator found, you cannot use md2ebook.'))
    check_dependency_epubcheck()
    return available
211400
def verify_package_status(self):
        """"""
        # rpm-libs is required for /usr/lib64/librpm*.so
        self.rpm.verify_packages_installed(['rpm-libs'])

        # Check RPM so files to build the Python binding.
        message_format = '''
RPM: {0} or
RPM download tool (dnf-plugins-core (dnf) or yum-utils (yum)) required.
Install any of those.
'''
        if self.rpm.has_composed_rpm_bulid_libs():
            if (not self.rpm.is_package_installed('rpm-build-libs')
               and not self.rpm.is_downloadable()):
                raise InstallError(message_format.format('rpm-build-libs'))
        else:
            # All the needed so files are included in rpm-libs package.
            pass
606001
def check_dependencies(specs)
      missing = check_app_requirement(specs)

      present = exclude_specs(installed, specs)
      future = present + specs

      check_all_dependencies(specs, future, missing)
    end
775256
def install_dependencies(dependencies, verbose=False):
    """"""
    if not dependencies:
        return

    stdout = stderr = None if verbose else subprocess.DEVNULL
    with tempfile.TemporaryDirectory() as req_dir:
        req_file = Path(req_dir) / "requirements.txt"

        with open(req_file, "w") as f:
            for dependency in dependencies:
                f.write(f"{dependency}\n")

        pip = ["python3", "-m", "pip", "install", "-r", req_file]
        # Unless we are in a virtualenv, we need --user
        if sys.base_prefix == sys.prefix and not hasattr(sys, "real_prefix"):
            pip.append("--user")

        try:
            subprocess.check_call(pip, stdout=stdout, stderr=stderr)
        except subprocess.CalledProcessError:
            raise Error(_("failed to install dependencies"))

        # Reload sys.path, to find recently installed packages
        importlib.reload(site)
1111022
def dependency_ran(self, test):
        """"""
        for d in (self.test_name(i) for i in dependencies[test]):
            if d not in self.ok_results:
                return "Required test '{}' did not run (does it exist?)".format(d)
        return None