from pathlib import Path
from typing import List


def git_https_packages_to_uninstall(env_path: Path) -> List[str]:
    """
    Look for lines of the form "git+https...#egg=name" and return a list of such "name" values.
    """
    to_uninstall = []
    with env_path.open() as inp:
        for line in inp:
            line = line.split("#")[0]  # remove any comments
            if line.find("git+https") > 0 and line.find("#egg="):
                name = line.strip().split("=")[-1]
                to_uninstall.append(name)
    return to_uninstall