|
6 | 6 | from setuptools import setup |
7 | 7 | from setuptools_git_versioning import count_since, get_branch, get_sha, get_tags |
8 | 8 |
|
9 | | -LAST_RELEASE_VERSION = Version("0.3.0") |
| 9 | +LAST_RELEASE_VERSION = Version("0.4.0") |
10 | 10 | TAG_VERSION_PATTERN = re.compile(r"^v(\d+\.\d+\.\d+)$") |
11 | 11 |
|
12 | 12 |
|
@@ -67,17 +67,19 @@ def get_next_version( |
67 | 67 | return version, tag, build_iteration |
68 | 68 |
|
69 | 69 | # not in release pathway, so need to increment to target next release version |
70 | | - version = Version(f"{version.major}.{version.minor + 1}.0") |
| 70 | + version_next = Version(f"{version.major}.{version.minor + 1}.0") |
71 | 71 |
|
72 | 72 | if build_type == "candidate": |
73 | 73 | # add 'rc' since we are in candidate pathway |
74 | | - version = Version(f"{version}.rc{build_iteration}") |
| 74 | + version = Version(f"{version_next}.rc{build_iteration}") |
75 | 75 | elif build_type in ["nightly", "alpha"]: |
76 | 76 | # add 'a' since we are in nightly or alpha pathway |
77 | | - version = Version(f"{version}.a{build_iteration}") |
78 | | - else: |
79 | | - # assume 'dev' if not in any of the above pathways |
80 | | - version = Version(f"{version}.dev{build_iteration}") |
| 77 | + version = Version(f"{version_next}.a{build_iteration}") |
| 78 | + # assume 'dev' if not in any of the above pathways |
| 79 | + # None indicates git failed to find last tag |
| 80 | + # 0 indicates no new commits since last tag |
| 81 | + elif commits_since_last != 0: |
| 82 | + version = Version(f"{version_next}.dev{build_iteration}") |
81 | 83 |
|
82 | 84 | return version, tag, build_iteration |
83 | 85 |
|
|
0 commit comments