def verify_equal_package_versions(packages):
    """
    Verify that all packages have the same version number.

    :param packages: The list of ``Package`` objects, ``list``
    :returns: The version number
    :raises: :exc:RuntimeError` If the version is not equal in all packages
    """
    version = None
    for package in packages:
        if version is None:
            version = package.version
        elif package.version != version:
            raise RuntimeError(
                """Two packages have different version numbers (%s != %s):
- %s
- %s"""
                 % (package.version, version, package.filename, list(
                packages)[0].filename))
    return version
