Пример #1
0
 def create_version_from_tag(
         self, tagref: git.refs.tag.TagReference
 ) -> Version:
     """Create a version from a tag."""
     if tagref.tag is None or self.config.always_use_commit_date:
         timestamp = tagref.commit.committed_date
     else:
         timestamp = tagref.tag.tagged_date
     return Version.from_version_str(
             tagref.name, pendulum.from_timestamp(timestamp),
             tagref.commit.hexsha)
Пример #2
0
 def _keep_only_semver(self, tags: List[Tuple[str, str]]) -> List[Tuple[str, str]]:
     semver_tags: List[Tuple[Version, str, str]] = []
     for sha1, tag in tags:
         if (v := Version.from_version_str(tag, pendulum.now(), '')).is_semantic_version:
             semver_tags.append((v, sha1, tag))