Beispiel #1
0
 def __init__(self, version_components, version_tag, is_dev_version):
     assert (isinstance(version_components, list))
     assert (all(isstring(item) for item in version_components))
     assert (isstring(version_tag))
     self.version_components = version_components
     self.version_tag = version_tag
     self.is_stable = (not is_dev_version) and self.version_tag in ["", "stable", "final"]
Beispiel #2
0
 def __init__(self, version_components, version_tag, is_dev_version):
     assert (isinstance(version_components, list))
     assert (all(isstring(item) for item in version_components))
     assert (isstring(version_tag))
     self.version_components = version_components
     self.version_tag = version_tag
     self.is_stable = (not is_dev_version) and self.version_tag in [
         "", "stable", "final"
     ]
Beispiel #3
0
 def __init__(self, git_tag_name, git_commits_since_tag, git_commit_id, git_tag_exists, modified_since_commit):
     assert (isstring(git_tag_name))
     assert (isinstance(git_commits_since_tag, int))
     assert (isstring(git_commit_id))
     assert (isinstance(git_tag_exists, bool))
     assert (isinstance(modified_since_commit, bool))
     self.git_tag_name = git_tag_name
     self.git_commits_since_tag = git_commits_since_tag
     self.git_commit_id = git_commit_id
     self.git_tag_exists = git_tag_exists
     self.modified_since_commit = modified_since_commit
     self.is_dev = modified_since_commit or (not git_tag_exists) or (git_commits_since_tag != 0)
Beispiel #4
0
 def __init__(self, git_tag_name, git_commits_since_tag, git_commit_id,
              git_tag_exists, modified_since_commit):
     assert (isstring(git_tag_name))
     assert (isinstance(git_commits_since_tag, int))
     assert (isstring(git_commit_id))
     assert (isinstance(git_tag_exists, bool))
     assert (isinstance(modified_since_commit, bool))
     self.git_tag_name = git_tag_name
     self.git_commits_since_tag = git_commits_since_tag
     self.git_commit_id = git_commit_id
     self.git_tag_exists = git_tag_exists
     self.modified_since_commit = modified_since_commit
     self.is_dev = modified_since_commit or (not git_tag_exists) or (
         git_commits_since_tag != 0)
Beispiel #5
0
def _parse_git_version(git_version_string, modified_since_commit):
    assert(isstring(git_version_string))
    matched = re.match("^([a-zA-Z0-9\.\-/]+)-([0-9]+)-g([0-9a-f]+)$", git_version_string)
    if matched:
        tag = matched.group(1)
        commits_since_tag = int(matched.group(2))
        commit_id = matched.group(3)
        return versioninfo.VersionInfo(git_tag_name=tag, git_commits_since_tag=commits_since_tag,
                                       git_commit_id=commit_id, git_tag_exists=True,
                                       modified_since_commit=modified_since_commit)
    else:
        raise VersionParseError(git_version_string)
Beispiel #6
0
def _parse_git_version(git_version_string, modified_since_commit):
    assert (isstring(git_version_string))
    matched = re.match("^([a-zA-Z0-9\.\-/]+)-([0-9]+)-g([0-9a-f]+)$",
                       git_version_string)
    if matched:
        tag = matched.group(1)
        commits_since_tag = int(matched.group(2))
        commit_id = matched.group(3)
        return versioninfo.VersionInfo(
            git_tag_name=tag,
            git_commits_since_tag=commits_since_tag,
            git_commit_id=commit_id,
            git_tag_exists=True,
            modified_since_commit=modified_since_commit)
    else:
        raise VersionParseError(git_version_string)