Skip to content

Commit

Permalink
Get version from version.py instead of grepping the osg-configure script
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasselmeci committed Jun 25, 2018
1 parent 82d413d commit c2de498
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions osg_configure/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.3.1"
4 changes: 2 additions & 2 deletions scripts/osg-configure
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ConfigParser
import logging
import traceback

from osg_configure.version import __version__
from osg_configure.modules import exceptions
from osg_configure.modules import utilities
from osg_configure.modules import configfile
Expand All @@ -15,7 +16,6 @@ from osg_configure.modules import validation

############################# Constant Definitions ############################

VERSION = '2.3.1'
CONFIGURE = 1
VERIFY = 2
LIST = 4
Expand Down Expand Up @@ -465,7 +465,7 @@ def main():
normal_exit_message = "Configuration completed, exiting..."
error_exit_message = "Critical error occurred, exiting..."

parser = optparse.OptionParser(usage='Usage: %prog [options] arg1 arg2', version='%prog ' + VERSION)
parser = optparse.OptionParser(usage='Usage: %prog [options] arg1 arg2', version='%prog ' + __version__)
parser.add_option('-d',
'--debug',
action='store_true',
Expand Down
13 changes: 3 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
from distutils.core import setup
import glob, re, os
import glob, os


def get_version():
"""
Gets version from osg-configure script file
"""
buffer = open('scripts/osg-configure').read()
match = re.search("VERSION\s+=\s+'(.*)'", buffer)
return match.group(1)
from osg_configure.version import __version__


def get_data_files():
Expand Down Expand Up @@ -44,7 +37,7 @@ def get_data_files():


setup(name='osg-configure',
version=get_version(),
version=__version__,
description='Package for osg-configure and associated scripts',
author='Suchandra Thapa',
author_email='[email protected]',
Expand Down

0 comments on commit c2de498

Please sign in to comment.