Generator yielding one Package instance for every corresponing line in a
    requirements file

def read_packages(reqs_file):
    """
    Generator yielding one Package instance for every corresponing line in a
    requirements file
    """
    for line in stream_file_lines(reqs_file):
        line = line.strip()
        if not line.startswith(('#', '--hash')):
            match = DEP_PATTERN.match(line)
            if match:
                package, version, marker = match.groups()
                yield Package(package.lower(), version, marker)