diff --git a/bin/gtdb_release_tk b/bin/gtdb_release_tk index efad845..f9ceb20 100755 --- a/bin/gtdb_release_tk +++ b/bin/gtdb_release_tk @@ -30,20 +30,12 @@ import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - from gtdb_release_tk.main import OptionsParser - +from gtdb_release_tk import version from biolib.logger import logger_setup from biolib.misc.custom_help_formatter import CustomHelpFormatter -def version(): - """Read program version from file.""" - import gtdb_release_tk - version_file = open(os.path.join(gtdb_release_tk.__path__[0], 'VERSION')) - return version_file.readline().strip() - - def print_help(): """Help menu.""" diff --git a/gtdb_release_tk/__init__.py b/gtdb_release_tk/__init__.py index e69de29..e914db8 100644 --- a/gtdb_release_tk/__init__.py +++ b/gtdb_release_tk/__init__.py @@ -0,0 +1,30 @@ +############################################################################### +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +import os + + +def version(): + """Read program version from file. + + Returns + ------- + str + The current version number (e.g. 0.2.2). + """ + with open(os.path.join(__path__[0], 'VERSION'), 'r') as f: + return f.readline().strip()