Skip to content

Commit

Permalink
Merge pull request #1 from Ecogenomics/conda_updates
Browse files Browse the repository at this point in the history
packaging for conda
  • Loading branch information
aaronmussig committed Mar 16, 2020
2 parents 15c7a01 + 8c24cd2 commit 77dee16
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# IntelliJ
.idea
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# gtdb-migration-tk
[![ace-internal](https://img.shields.io/conda/vn/ace-internal/gtdb_migration_tk.svg?color=green)](https://anaconda.org/ace-internal/gtdb_migration_tk)

Toolkit for updating the GTDB to the next release and test data
22 changes: 6 additions & 16 deletions bin/gtdb_migration_tk
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,25 @@ __maintainer__ = "Pierre Chaumeil"
__email__ = "uqpchaum@uq.edu.au"
__status__ = "Development"

import argparse
import os
import sys
import ntpath
import logging
import argparse

sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))


from gtdb_migration_tk.main import OptionsParser

from biolib.logger import logger_setup
from biolib.misc.custom_help_formatter import CustomHelpFormatter
from biolib.common import make_sure_path_exists


def version():
"""Read program version from file."""
import gtdb_migration_tk
version_file = open(os.path.join(gtdb_migration_tk.__path__[0], 'VERSION'))
return version_file.readline().strip()
from gtdb_migration_tk import __version__


def print_help():
"""Help menu."""

print('')
print(' ...::: GTDB Migration Toolkit v' +
version() + ' :::...''')
__version__ + ' :::...''')
print('''\
NCBI folder to GTDB folder:
Expand Down Expand Up @@ -274,7 +264,7 @@ if __name__ == '__main__':

# get and check options
args = None
if(len(sys.argv) == 1 or sys.argv[1] == '-h' or sys.argv == '--help'):
if len(sys.argv) == 1 or sys.argv[1] in {'-h', '--help'}:
print_help()
sys.exit(0)
else:
Expand All @@ -284,13 +274,13 @@ if __name__ == '__main__':
logger_setup(args.output_dir,
'gtdb_migration_tk.log',
'GTDB Migration Tk',
version(),
__version__,
args.silent)
except:
logger_setup(None,
'gtdb_migration_tk.log',
'GTDB Migration Tk',
version(),
__version__,
args.silent)

# do what we came here to do
Expand Down
22 changes: 22 additions & 0 deletions gtdb_migration_tk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
###############################################################################
# #
# 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

# Set the module version.
with open(os.path.join(__path__[0], 'VERSION'), 'r') as f:
__version__ = f.readline().strip()
28 changes: 28 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python

import os

from setuptools import setup


def version():
setup_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(setup_dir, 'gtdb_migration_tk', 'VERSION'), 'r') as f:
return f.readline().strip()


setup(
name='gtdb_migration_tk',
python_requires='>=3.6',
version=version(),
author='Pierre-Alain Chaumeil',
author_email='p.chaumeil@uq.edu.au',
maintainer='Pierre-Alain Chaumeil, Aaron Mussig, and Donovan Parks',
maintainer_email='p.chaumeil@uq.edu.au',
packages=['gtdb_migration_tk'],
scripts=['bin/gtdb_migration_tk'],
package_data={'gtdb_migration_tk': ['VERSION']},
url='https://github.com/Ecogenomics/gtdb-migration-tk',
description='Toolkit for updating the GTDB to the next release and test data.',
install_requires=['requests', 'unidecode', 'biolib>=0.1.0', 'pandas', 'numpy'],
)

0 comments on commit 77dee16

Please sign in to comment.