def get_full_version(package_data):
    """
    Given a mapping of package_data that contains a version and may an epoch and
    release, return a complete version.

    For example::
    >>> get_full_version(dict(version='1.2.3'))
    '1.2.3'
    >>> get_full_version(dict(version='1.2.3', epoch='2'))
    '2~1.2.3'
    >>> get_full_version(dict(version='1.2.3', epoch='2', release='23'))
    '2~1.2.3-23'
    """
    version = package_data['version']

    release = package_data.get('release', '')
    if release:
        release = f'-{release}'

    epoch = package_data.get('epoch', '')
    if epoch:
        epoch = f'{epoch}~'

    version = f'{epoch}{version}{release}'
    return version