X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=htsworkflow%2Futil%2Fversion.py;fp=htsworkflow%2Futil%2Fversion.py;h=8097edbedb8d95acddad2c9626d47050c4d92817;hb=1d7536c7a298329915775afb14e7a3c445371573;hp=0000000000000000000000000000000000000000;hpb=2816ef120f54daaf9ef5d6f70bb19e379f5ab955;p=htsworkflow.git diff --git a/htsworkflow/util/version.py b/htsworkflow/util/version.py new file mode 100644 index 0000000..8097edb --- /dev/null +++ b/htsworkflow/util/version.py @@ -0,0 +1,21 @@ +import logging + +LOGGER = logging.getLogger(__name__) + +def version(): + """Return version number + """ + version = None + try: + import pkg_resources + except ImportError, e: + LOGGER.error("Can't find version number, please install setuptools") + raise e + + try: + version = pkg_resources.get_distribution("htsworkflow") + except pkg_resources.DistributionNotFound, e: + LOGGER.error("Package not installed") + + return version +