Skip to content

Commit

Permalink
Fixed version parsing for setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmussig committed Mar 15, 2020
1 parent 5569571 commit 8ff13a2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
10 changes: 1 addition & 9 deletions bin/gtdb_release_tk
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
30 changes: 30 additions & 0 deletions gtdb_release_tk/__init__.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>. #
# #
###############################################################################

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()

0 comments on commit 8ff13a2

Please sign in to comment.