Skip to content

Commit 828b19e

Browse files
committed
Add version module to source.
CC-52
1 parent 73be054 commit 828b19e

File tree

4 files changed

+7
-20
lines changed

4 files changed

+7
-20
lines changed

comodit_client/.gitignore

-1
This file was deleted.

comodit_client/dispatch.py

+2-11
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from .control.platforms import PlatformsController
3535
from .rest.exceptions import ApiException
3636
from .util.editor import NotModifiedException
37+
import comodit_client.version as version
3738

3839

3940
def run(argv):
@@ -178,17 +179,7 @@ def _parse(argv):
178179
config.param_completions = -1
179180

180181
if "--version" in argv:
181-
version = "NO_VERSION"
182-
release = "NO_RELEASE"
183-
try:
184-
import version as version_mod
185-
if version_mod.VERSION:
186-
version = version_mod.VERSION
187-
if version_mod.RELEASE:
188-
release = version_mod.RELEASE
189-
except ImportError:
190-
pass
191-
print("ComodIT command line client " + version + "-" + release + ".")
182+
print("ComodIT command line client " + version.VERSION + "-" + version.RELEASE + ".")
192183
exit(0)
193184

194185
# Parse arguments

comodit_client/version.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VERSION="1.21"
2+
RELEASE="dev"

setup.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,9 @@ def get_template_files():
2121
files.append('templates/' + name)
2222
return files
2323

24-
VERSION = '0.0'
25-
RELEASE = '0'
26-
try:
27-
from comodit_client import version
28-
VERSION = version.VERSION
29-
RELEASE = version.RELEASE
30-
except ImportError:
31-
pass
24+
from comodit_client import version
25+
VERSION = version.VERSION
26+
RELEASE = version.RELEASE
3227

3328
setup(
3429
name = 'comodit-client',

0 commit comments

Comments
 (0)