/
setup.py
76 lines (61 loc) · 2.1 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, redbiom development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ----------------------------------------------------------------------------
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
from setuptools.command.sdist import sdist
# based on http://stackoverflow.com/a/36902139
def _post():
import nltk
nltk.download('stopwords')
nltk.download('punkt')
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
install.run(self)
_post()
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
develop.run(self)
_post()
class sdistCommand(sdist):
def run(self):
# verify that we can actually do the converstion
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
sdist.run(self)
# pypi does not render markdown.
# https://stackoverflow.com/a/26737672/19741
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
# adapted from q2cli's setup.py
setup(
name='redbiom',
version='0.3.0',
license='BSD-3-Clause',
author='Daniel McDonald',
author_email='wasade@gmail.com',
url='https://github.com/biocore/redbiom',
packages=find_packages(),
long_description=long_description,
include_package_data=True,
install_requires=['click >= 6.7', 'biom-format >= 2.1.5',
'requests', 'h5py', 'pandas', 'nltk',
'joblib', 'scikit-bio >= 0.4.2', 'msgpack'],
entry_points='''
[console_scripts]
redbiom=redbiom.commands:cli
''',
cmdclass={'install': PostInstallCommand,
'develop': PostDevelopCommand}
)