[DEV] correct the wrong version number when install

This commit is contained in:
Edouard DUPIN 2019-08-28 22:54:41 +02:00
parent 843c1296a6
commit 58602345b5
3 changed files with 21 additions and 1 deletions

View File

@ -1,2 +1,3 @@
include README.rst
include bash-autocompletion/lutin
include version.txt

View File

@ -28,6 +28,7 @@ import lutin.tools as lutinTools
myArgs = arguments.Arguments()
myArgs.add("h", "help", desc="Display this help")
myArgs.add("H", "HELP", desc="Display this help (with all compleate information)")
myArgs.add("", "version", desc="Display the application version")
myArgs.add_section("option", "Can be set one time in all case")
myArgs.add("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"],["6","extreme_verbose"]], desc="display makefile debug level (verbose) default =2")
myArgs.add("C", "color", desc="Display makefile output in color")
@ -172,6 +173,19 @@ def usage(full=False):
print(" ex gcov with output: " + sys.argv[0] + " -cgcc --gcov -mdebug etk-test?build?run etk?gcov:output")
exit(0)
##
## @brief Display the version of this package.
##
def version():
color = debug.get_color_set()
import pkg_resources
print("version: " + str(pkg_resources.get_distribution('lutin').version))
foldername = os.path.dirname(__file__)
print("source folder is: " + foldername)
exit(0)
def check_boolean(value):
if value == "" \
or value == "1" \
@ -188,6 +202,10 @@ def parseGenericArg(argument, active):
if active == False:
usage()
return True
if argument.get_option_name() == "version":
if active == False:
version()
return True
if argument.get_option_name() == "HELP":
if active == False:
usage(True)

View File

@ -37,7 +37,8 @@ setup(name='lutin',
packages=['lutin',
'lutin/z_builder',
'lutin/z_system',
'lutin/z_target'],
'lutin/z_target',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',