def __pretty_version__(self): from topicexplorer.update import get_dist from pip.utils import dist_is_editable dist = get_dist('topicexplorer') __pv__ = None if dist_is_editable(dist): import subprocess __pv__ = subprocess.check_output( 'git describe --long --tags --always --dirty', cwd=dist.location, shell=True) __pv__ = __pv__.strip() return __pv__ or self.__version__