def parse_requirements(filename):
    """ load requirements from a pip requirements file. (replacing from pip.req import parse_requirements)"""
    lineiter = (line.strip() for line in open(filename))
    reqs = [line for line in lineiter if line and not line.startswith("#")]
    if sys.platform == "win32":
        reqs.append('pywin32')
    # if py<=3.6 add dataclasses
    if sys.version_info.major == 3 and sys.version_info.minor <= 6:
        reqs.append("dataclasses")
    if sys.version_info.major == 3 and sys.version_info.minor <= 7:
        reqs.remove("facebook-wda>=1.3.3")
        reqs.append("facebook-wda<1.4.8")
    if is_docker():
        reqs.remove("opencv-contrib-python>=4.4.0.46, <=4.6.0.66")
        reqs.append("opencv-contrib-python-headless==4.5.5.64")
    return reqs
 load requirements from a pip requirements file. (replacing from pip.req import parse_requirements)
setup.py