Skip to content

Commit 9a56f3a

Browse files
TimPansinohmstepaneklrafeei
authored
Update Versioning Scheme (#651)
* Update versioning scheme to 3 semver digits * Fix version indexing Co-authored-by: Hannah Stepanek <[email protected]> Co-authored-by: Lalleh Rafeei <[email protected]> * Remove version truncation * [Mega-Linter] Apply linters fixes * Bump tests Co-authored-by: Hannah Stepanek <[email protected]> Co-authored-by: Lalleh Rafeei <[email protected]> Co-authored-by: TimPansino <[email protected]>
1 parent f007904 commit 9a56f3a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

newrelic/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
# limitations under the License.
1414

1515
import os.path
16+
1617
THIS_DIR = os.path.dirname(__file__)
1718

1819
try:
19-
with open(os.path.join(THIS_DIR, 'version.txt'), 'r') as f:
20+
with open(os.path.join(THIS_DIR, "version.txt"), "r") as f:
2021
version = f.read()
2122
except:
22-
version = '0.0.0.0'
23+
version = "0.0.0"
2324

24-
version_info = list(map(int, version.split('.')))
25+
version_info = list(map(int, version.split(".")))

setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@
4545
def newrelic_agent_guess_next_version(tag_version):
4646
version, _, _ = str(tag_version).partition("+")
4747
version_info = list(map(int, version.split(".")))
48-
if len(version_info) < 4:
48+
if len(version_info) < 3:
4949
return version
5050
version_info[1] += 1
51-
if version_info[1] % 2:
52-
version_info[3] = 0
53-
else:
54-
version_info[3] += 1
51+
version_info[2] = 0
5552
return ".".join(map(str, version_info))
5653

5754

@@ -134,7 +131,7 @@ def build_extension(self, ext):
134131
use_scm_version={
135132
"version_scheme": newrelic_agent_next_version,
136133
"local_scheme": "no-local-version",
137-
"git_describe_command": "git describe --dirty --tags --long --match *.*.*.*",
134+
"git_describe_command": "git describe --dirty --tags --long --match *.*.*",
138135
"write_to": "newrelic/version.txt",
139136
},
140137
setup_requires=["setuptools_scm>=3.2,<7"],

0 commit comments

Comments
 (0)