def local_version2str(version):
    """
    Create the local part of a PEP440 version string

    :param version: version object as :obj:`setuptools_scm.version.ScmVersion`
    :return: local version string
    """
    if version.exact:
        return ''
    else:
        if version.dirty:
            return version.format_with('+n{node}.dirty')
        else:
            return version.format_with('+n{node}')