def METHOD_NAME(self) -> set[str]:
    # TODO: this should move into poetry-core
    return {
        group.name
        for group in self.poetry.package._dependency_groups.values()
        if not group.is_optional()
    }