Skip to content

Commit a3cf252

Browse files
ref: Drop version script; consolidate version logic in setup.py (#594)
1 parent 96e9f97 commit a3cf252

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

setup.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python3
2+
import os
23
import pathlib
34
import subprocess
45
import sys
@@ -10,6 +11,8 @@
1011
here = pathlib.Path().absolute()
1112

1213

14+
ENV_LINODE_CLI_VERSION = "LINODE_CLI_VERSION"
15+
1316
# get the long description from the README.md
1417
with open(here / "README.md", encoding="utf-8") as f:
1518
long_description = f.read()
@@ -31,16 +34,6 @@ def get_baked_files():
3134
return data_files
3235

3336

34-
def get_version():
35-
"""
36-
Uses the version file to calculate this package's version
37-
"""
38-
return (
39-
subprocess.check_output([sys.executable, "./version"])
40-
.decode("utf-8")
41-
.rstrip()
42-
)
43-
4437

4538
def get_baked_version():
4639
"""
@@ -71,7 +64,7 @@ def bake_version(v):
7164
version = get_baked_version()
7265
else:
7366
# Otherwise, retrieve and bake the version as normal
74-
version = get_version()
67+
version = os.getenv(ENV_LINODE_CLI_VERSION) or "0.0.0"
7568
bake_version(version)
7669

7770
with open("requirements.txt") as f:

version

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)