From 58602345b592c01d0bbf7d4379ec28cfeeaad8bd Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 28 Aug 2019 22:54:41 +0200 Subject: [PATCH] [DEV] correct the wrong version number when install --- MANIFEST.in | 1 + bin/lutin | 18 ++++++++++++++++++ setup.py | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index f092607..81d0cc3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include README.rst include bash-autocompletion/lutin +include version.txt diff --git a/bin/lutin b/bin/lutin index db01f51..95f5497 100755 --- a/bin/lutin +++ b/bin/lutin @@ -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) diff --git a/setup.py b/setup.py index 547210a..fd78374 100755 --- a/setup.py +++ b/setup.py @@ -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)',