PyRequirementVersionSpec (@NotNull String versionSpec) { PyRequirementRelation relation = null; if (versionSpec.startsWith("===")) { relation = PyRequirementRelation.STR_EQ; } else if (versionSpec.startsWith("==")) { relation = PyRequirementRelation.EQ; } else if (versionSpec.startsWith("<=")) { relation = PyRequirementRelation.LTE; } else if (versionSpec.startsWith(">=")) { relation = PyRequirementRelation.GTE; } else if (versionSpec.startsWith("<")) { relation = PyRequirementRelation.LT; } else if (versionSpec.startsWith(">")) { relation = PyRequirementRelation.GT; } else if (versionSpec.startsWith("~=")) { relation = PyRequirementRelation.COMPATIBLE; } else if (versionSpec.startsWith("!=")) { relation = PyRequirementRelation.NE; } if (relation != null) { final int versionIndex = findFirstNotWhiteSpaceAfter(versionSpec, relation.getPresentableText().length()); return PyRequirementsKt.pyRequirementVersionSpec(relation, versionSpec.substring(versionIndex)); } return null; }