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:
content = match.read()
for reqs in parse_requirements(content):
if reqs.name == name:
try:
return requirements.Requirement(str(reqs)).specifier.contains(
version
)
except InvalidVersion:
return False
raise ValueError("%s is not in %s" % (name, Version.FILE_NAME))