@staticmethod<EOL><INDENT>def _parse_artifact_version(package_name: str, artifact_name: str) -> str:<DEDENT>
if artifact_name.endswith("<STR_LIT>"):<EOL><INDENT>version = artifact_name[len(package_name) + <NUM_LIT:1>:-len("<STR_LIT>")]<EOL><DEDENT>elif artifact_name.endswith("<STR_LIT>"):<EOL><INDENT>parsed_package_name, version, _ = artifact_name.split("<STR_LIT:->", maxsplit=<NUM_LIT:2>)<EOL>if parsed_package_name.lower() != package_name:<EOL><INDENT>_LOGGER.warning(<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise InternalError(<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT>_LOGGER.debug(f"<STR_LIT>")<EOL>return version<EOL>
Parse package version based on artifact name available on the package source index.