def is_semantic_ver_tag(tag: str) -> bool: try: tag_to_version(tag) return True except ValueError: pass return False
def test_tag_to_version(): assert str(version.tag_to_version('1.0.0-rc0_152')) == '1.0.0-rc0+152' assert str(version.tag_to_version('1.0.0-rc0')) == '1.0.0-rc0'