def version_match()

in src/pydolphinscheduler/utils/versions.py [0:0]


def version_match(name: str, version: str) -> bool:
    """Check if the version of external system matches current python sdk version.

    :param name: External system name in file ``Version.FILE_NAME``
    :param version: External system current version
    """
    path = Path(__file__).parent.parent.joinpath(Version.FILE_NAME)
    with path.open() as match:
        for line in match.readlines():
            req = packaging_Requirement(line)
            if req.name == name:
                try:
                    return req.specifier.contains(version)
                except InvalidVersion:
                    return False
        raise ValueError(f"{name} is not in {Version.FILE_NAME}")