From 6bea62fadc6ba82a7cba21c8024c7a31e66c3e98 Mon Sep 17 00:00:00 2001 From: Robert Edwards Date: Mon, 17 Aug 2020 17:21:02 +0930 Subject: [PATCH] updating version handling and adding version to log --- PhiSpy.py | 3 ++- PhiSpyModules/__init__.py | 4 ++-- PhiSpyModules/helper_functions.py | 6 +----- VERSION | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/PhiSpy.py b/PhiSpy.py index 674b709..abf3ec2 100755 --- a/PhiSpy.py +++ b/PhiSpy.py @@ -2,6 +2,7 @@ import os import sys import gzip +import pkg_resources from functools import reduce from Bio import SeqIO @@ -11,13 +12,13 @@ import PhiSpyModules - def main(argv): #organismPath, output_dir, trainingFlag, INSTALLATION_DIR, evaluateOnly, threshold_for_FN, phageWindowSize, quietMode, keep): ###################################### # parse the options # ###################################### args_parser = PhiSpyModules.get_args() + PhiSpyModules.log_and_message(f"Welcome to PhiSpy.py version {PhiSpyModules.__version__}\n") PhiSpyModules.log_and_message(f"Starting PhiSpy.py with the following arguments\n{args_parser}") # if we get here we need an input file diff --git a/PhiSpyModules/__init__.py b/PhiSpyModules/__init__.py index 508d068..75bfdd6 100644 --- a/PhiSpyModules/__init__.py +++ b/PhiSpyModules/__init__.py @@ -12,7 +12,6 @@ from .search_phmms import search_phmms from .log_and_message import log_and_message, message from .errors import ColorNotFoundError, NoBasesCounted - from .version import __version__ __all__ = ['SeqioFilter', @@ -26,5 +25,6 @@ 'prophage_measurements_to_tbl', 'write_all_outputs', 'write_prophage_information', 'log_and_message', 'search_phmms', 'message', - 'ColorNotFoundError', 'NoBasesCounted' + 'ColorNotFoundError', 'NoBasesCounted', + '__version__' ] diff --git a/PhiSpyModules/helper_functions.py b/PhiSpyModules/helper_functions.py index 5493343..c64ccf7 100755 --- a/PhiSpyModules/helper_functions.py +++ b/PhiSpyModules/helper_functions.py @@ -8,11 +8,7 @@ import logging from .log_and_message import message - -try: - __version__ = pkg_resources.get_distribution('phispy').version -except Exception: - __version__ = 'unknown' +from .version import __version__ def print_list(): f = None diff --git a/VERSION b/VERSION index 1b94a07..73274fd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.16 +4.1.17