Check if directory-components is listed in requirements files.
188204
def header_footer_exists(filepath):
    """"""
    with open(filepath) as f:
        return re.search(Utils.exp, f.read())
1031470
private static boolean requiredByOtherFeature(Map<String, ProvisioningFeatureDefinition> features, File baseDir, File testFile) {
        for (ProvisioningFeatureDefinition fd : features.values()) {
            if (requiredByFile(fd, baseDir, testFile))
                return true;
        }
        return false;
    }
572981
def check_dependency(self, dependency_path):
        """"""
        stored_hash = self._stamp_file_hashes.get(dependency_path)

        # This file was newly added, or we don't have a file
        # with stored hashes yet. Assume out of date.
        if not stored_hash:
            return False

        return stored_hash == _sha1_for_file(dependency_path)
577387
def parse_requirements(fname='requirements.txt'):
    
    from os.path import dirname, join, exists
    import re
    require_fpath = join(dirname(__file__), fname)
    # This breaks on pip install, so check that it exists.
    if exists(require_fpath):
        with open(require_fpath, 'r') as f:
            packages = []
            for line in f.readlines():
                line = line.strip()
                if line and not line.startswith('#'):
                    if line.startswith('-e '):
                        package = line.split('#egg=')[1]
                        packages.append(package)
                    else:
                        pat = '|'.join(['>', '>=', '=='])
                        package = re.split(pat, line)[0]
                        packages.append(package)
            return packages
    return []
139391
def requirements(filename):
    """"""
    with open(filename) as f:
        return [x.strip() for x in f.readlines() if x.strip()]
1140685
protected function detectUiComponents()
    {

        /* @var $extensionsManager Manager */
        $extensionsManager = app()->make(Manager::class);
        $components        = [];
        $directories       = [];

        foreach ($this->paths as $path) {
            try {
                $directories[] = $this->files->directories($path);
            } catch (Exception $ex) {
                continue;
            }
        }

        $directories = count($directories) ? array_merge(...$directories) : [];
        $inner       = [];

        foreach ($directories as $index => $directory) {
            $classBasename = class_basename($directory);

            if (!in_array($classBasename, ['Widgets', 'UiComponents'], true) || !$extensionsManager->getActiveExtensionByPath($directory)) {
                unset($directories[$index]);
                continue;
            }

            if (!empty($componentDirectory = $this->files->directories($directory))) {
                $inner[] = $componentDirectory;
            }
        }

        $inner       = count($inner) ? array_merge(...$inner) : [];
        $directories = array_merge($directories, $inner);

        foreach ($directories as $directory) {
            $components[] = $this->files->files($directory);
        }
        return count($components) ? array_merge(...$components) : [];
    }
638182
def are_requirements_changed(config):
    
    deps = (dep.name for dep in config.deps)

    def build_fpath_for_previous_version(fname):
        tox_dir = config.config.toxworkdir.strpath
        envdirkey = _str_to_sha1hex(str(config.envdir))
        fname = '{0}.{1}.previous'.format(fname.replace('/', '-'), envdirkey)
        return os.path.join(tox_dir, fname)

    requirement_files = map(parse_requirements_fname, deps)
    return any([
        is_changed(reqfile, build_fpath_for_previous_version(reqfile))
        for reqfile in requirement_files
        if reqfile and os.path.isfile(reqfile)])
551107
def as_requirement(self):
        """"""
        if isinstance(self.parsed_version, packaging.version.Version):
            spec = "%s==%s" % (self.project_name, self.parsed_version)
        else:
            spec = "%s===%s" % (self.project_name, self.parsed_version)

        return Requirement.parse(spec)
663670
def parse_requirements(filename):
    
    with open(filename, 'r') as f:
        lineiter = list(line.strip() for line in f)
    return [line for line in lineiter if line and not line.startswith("#")]
960701
function requirementsFileExists(servicePath, options, fileName) {
  if (
    options.usePoetry &&
    fse.existsSync(path.join(servicePath, 'pyproject.toml'))
  ) {
    return true;
  }

  if (options.usePipenv && fse.existsSync(path.join(servicePath, 'Pipfile'))) {
    return true;
  }

  if (fse.existsSync(fileName)) {
    return true;
  }

  return false;
}
488189
def get_install_requires():
    """"""
    base = os.path.abspath(os.path.dirname(__file__))
    requirements_file = os.path.join(base, 'requirements.txt')
    if not os.path.exists(requirements_file):
        return []
    with open(requirements_file, mode='rt', encoding='utf-8') as f:
        return f.read().splitlines()
195107
def resolve!
      self.bundles.each do |bundle_name, requirements|
        self.paths[bundle_name] = []
        requirements.each do |name, version|
          path = self.index.find(name, version)
          if !path
            raise(MissingFile,
            "Could not find #{name} #{version} in any of these paths #{index.directories.join(':')}")
          end
          self.paths[bundle_name] << [path, name, version]
        end
      end
      paths
    end
1371978
def ValidateVfsPath(path):
  """"""

  components = (path or "").lstrip("/").split("/")
  if not components:
    raise ValueError("Empty path is not a valid path: %s." %
                     utils.SmartStr(path))

  if components[0] not in ROOT_FILES_WHITELIST:
    raise ValueError(
        "First path component was '%s', but has to be one of %s" %
        (utils.SmartStr(components[0]), ", ".join(ROOT_FILES_WHITELIST)))

  return True
74885
function ensure(files, options) {
    // Update the global array of represented modules
    unused = filterRepresented(unused, files, options)

    verbose.writeln('Unrepresented modules list currently at ', unused)

    // Only print message when all targets have been run
    if (++numRuns === getNumTargets()) {
      if (unused.length) {
        if (options.report) {
          log.writeln('\nPackages left out:')
          log.writeln(unused.join('\n'))
        }
      } else if (options.report) {
        log.ok('All modules have something copied.')
      }
    }
  }
998374
def get_requirements(*args):
    """"""
    requirements = set()
    with open(get_absolute_path(*args)) as handle:
        for line in handle:
            # Strip comments.
            line = re.sub(r'^#.*|\s#.*', '', line)
            # Ignore empty lines
            if line and not line.isspace():
                requirements.add(re.sub(r'\s+', '', line))
    return sorted(requirements)
1131763
public void checkAllRequirementsSatisfied(final String currentPath) {
        StringBuilder errors = new StringBuilder();

        for (Field field: this.dependantsInJson) {
            final Collection<String> requirements = this.dependantToRequirementsMap.get(field);
            if (!requirements.isEmpty()) {
                errors.append("\n");
                String type = field.getType().getName();
                if (field.getType().isArray()) {
                    type = field.getType().getComponentType().getName() + "[]";
                }
                errors.append("\t* ").append(type).append(' ').append(field.getName()).append(" depends on ")
                        .append(requirements);
            }
        }
        Assert.equals(0, errors.length(),
                      "\nErrors were detected when analysing the @Requires dependencies of '" +
                              currentPath + "': " + errors);
    }
1228614
def get_requirements():
    """"""
    with open(os.path.join(topdir, 'requirements.txt')) as fin:
        lines = fin.readlines()
    lines = [line.strip() for line in lines]
    return lines