def parse_req(spec: str) -> str:
    """ Parse package name==version out of requirments file"""
    if ";" in spec:
        # remove restriction
        spec, _ = [x.strip() for x in spec.split(";", 1)]
    if "#" in spec:
        # remove comment
        spec = spec.strip().split("#")[0]
    if "\\" in spec:
        # remove line breaks
        spec = spec.strip().split("\\")[0]
    if "--hash=" in spec:
        # remove line breaks
        spec = spec.strip().split("--hash=")[0]
    return spec