def fetch_requirements(requirements_file_path):
    """
    Return a list of requirements and links by parsing the provided requirements file.
    """
    links = []
    reqs = []

    def _get_link(line):
        vcs_prefixes = ["git+", "svn+", "hg+", "bzr+"]

        for vcs_prefix in vcs_prefixes:
            if line.startswith(vcs_prefix) or line.startswith("-e %s" % (vcs_prefix)):
                req_name = re.findall(".*#egg=(.+)([&|@]).*$", line)

                if not req_name:
                    req_name = re.findall(".*#egg=(.+?)$", line)
                else:
                    req_name = req_name[0]

                if not req_name:
                    raise ValueError(
                        'Line "%s" is missing "#egg=<package name>"' % (line)
                    )

                link = line.replace("-e ", "").strip()
                return link, req_name[0]
            elif vcs_prefix in line and line.count("@") == 2:
                # PEP 440 direct reference: <package name>@ <url>@version
                req_name, link = line.split("@", 1)
                req_name = req_name.strip()
                link = f"{link.strip()}#egg={req_name}"
                return link, req_name

        return None, None

    with open(requirements_file_path, "r") as fp:
        for line in fp.readlines():
            line = line.strip()

            if line.startswith("#") or not line:
                continue

            link, req_name = _get_link(line=line)

            if link:
                links.append(link)
            else:
                req_name = line

            reqs.append(req_name)

    return (reqs, links)

    Return a list of requirements and links by parsing the provided requirements file.
    
st2tests/dist_utils.py