def get_latest_tag(self) -> typing.Optional[str]:
        """
        :return:latest tag on the repo in the form TAG[-DISTANCE+[DIRTY]]
        :rtype: str
        """
        try:
            latest_tag: str = self.repo.git.describe(tags=True, abbrev=0)
            LOGGER.debug('latest tag: %s', latest_tag)
            return latest_tag
        except GitCommandError as exc:
            if 'No names found' in exc.stderr:
                LOGGER.debug('no tag found in repo')
                return None
            raise
def get_latest_tag ( self ) -> typing . Optional [ str ] : try : latest_tag : str = self . repo . git . describe ( tags = True , abbrev = 0 ) LOGGER . debug ( 'latest tag: %s' , latest_tag ) return latest_tag except GitCommandError as exc : if 'No names found' in exc . stderr : LOGGER . debug ( 'no tag found in repo' ) return None raise
:return:latest tag on the repo in the form TAG[-DISTANCE+[DIRTY]]
        :rtype: str