def get_pypi_suffix(branch, commit) -> str:
    """Return PEP 440-compatible suffix based on branch type.
    """
    if branch == 'master':
        return ''
    elif branch.startswith('hotfix'):
        return '.post{}'.format(commit)
    elif branch.startswith('feat'):
        return '.dev{}'.format(commit)
    elif branch.startswith('release'):
        return '.rc{}'.format(commit)
    else:
        return 'a{}'.format(commit)