def parse_package_id(package_id: str):
    """
    Takes a package_id in the form 'scope.identifier.revision' and returns a
    triple (scope, identifier, revision) where the identifier and revision are
    ints, suitable for sorting.
    """
    *_, scope, identifier, revision = package_id.split('.')
    return scope, int(identifier), int(revision)