Read requirements from 'requirements txt'

    :return: requirements
    :rtype: list
341284
def get_requirements(filename=None):
    
    if filename is None:
        filename = 'requirements.txt'

    file = WORK_DIR / filename

    install_reqs = parse_requirements(str(file), session='hack')
    return [str(ir.req) for ir in install_reqs]
255191
def _get_implicit_requirements(
        self,
        fields,
        requirements
    ):
        """"""
        for name, field in six.iteritems(fields):
            source = field.source
            # Requires may be manually set on the field -- if not,
            # assume the field requires only its source.
            requires = getattr(field, 'requires', None) or [source]
            for require in requires:
                if not require:
                    # ignore fields with empty source
                    continue

                requirement = require.split('.')
                if requirement[-1] == '':
                    # Change 'a.b.' -> 'a.b.*',
                    # supporting 'a.b.' for backwards compatibility.
                    requirement[-1] = '*'
                requirements.insert(requirement, TreeMap(), update=True)
193386
def parse_requirements(requirements_filename):
    
    dependencies, dependency_links = [], []
    requirements_dir = os.path.dirname(requirements_filename)
    with open(requirements_filename, 'r') as stream:
        for line in stream:
            line = line.strip()
            if line.startswith("-r"):
                filename = os.path.join(requirements_dir, line[2:].strip())
                _dependencies, _dependency_links = parse_requirements(filename)
                dependencies.extend(_dependencies)
                dependency_links.extend(_dependency_links)
            elif line.startswith("http"):
                dependency_links.append(line)
            else:
                package = line.split('#')[0]
                if package:
                    dependencies.append(package)
    return dependencies, dependency_links
1076303
def _resolve_requirements_chain(requirements):
    '''
    
    '''

    chain = []

    if isinstance(requirements, six.string_types):
        requirements = [requirements]

    for req_file in requirements:
        chain.append(req_file)
        chain.extend(_resolve_requirements_chain(_find_req(req_file)))

    return chain
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 []
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()
344065
def get_requirements():
    """"""

    with open("requirements/project.txt") as f:
        requirements = []
        for line in f.readlines():
            line = line.strip()
            if line and not line.startswith('#'):
                requirements.append(line)
    return requirements
1228090
def _determine_filtered_package_requirements(self):
        
        filtered_requirements = set()
        try:
            lines = self.configuration["blacklist"]["packages"]
            package_lines = lines.split("\n")
        except KeyError:
            package_lines = []
        for package_line in package_lines:
            package_line = package_line.strip()
            if not package_line or package_line.startswith("#"):
                continue
            filtered_requirements.add(Requirement(package_line))
        return list(filtered_requirements)
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("#")]
730662
def parse_requirements(filename):
    
    lineiter = (line.strip() for line in open(filename))
    return (line for line in lineiter if line and not line.startswith("#"))
851274
def requirements(self, requires):
        '''
        
        '''
        if requires:
            if isinstance(requires, basestring) and \
               os.path.isfile(os.path.abspath(requires)):
                self._requirements_file = os.path.abspath(requires)
            else:
                if isinstance(self._requirements, basestring):
                    requires = requires.split()
                self._requirements_file = None
                self._requirements = requires
        else:
            # If the default requirements file is found use that
            if os.path.isfile(self._requirements_file):
                return
            self._requirements, self._requirements_file = None, None
772844
def get_requirements_file_from_url(url):
    """"""
    response = requests.get(url)

    if response.status_code == 200:
        return StringIO(response.text)
    else:
        return StringIO("")
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
1298950
def _parse_requirements(self, input):
        

        results = []

        for line in input:
            (package, version) = self._parse_line(line)
            if package:
                results.append((package, version))

        return tuple(results)
308571
def parse_requirements(filename):
    

    try:
        with open(filename) as fh_req:
            return [line.strip() for line in fh_req if line.strip() and not line.startswith('#')]
    except FileNotFoundError:
        print('File not found: {}'.format(realpath(filename)), file=stderr)
        raise
489186
def _read_requirements(filename):
    """"""
    with open(filename) as requirements_file:
        contents = requirements_file.read()
    return [line.strip() for line in contents.splitlines() if _is_requirement(line)]
1222627
def requirements_from_file(filename):
    """"""
    return [line.strip() for line in open(filename, 'r')
            if line.strip() and not line.strip().startswith('--')]