forked from biocore/qiime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
110 lines (94 loc) · 3.86 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env python
# File created on 17 Feb 2010
from __future__ import division
from distutils.core import setup
from distutils.sysconfig import get_python_lib
from os import chdir, getcwd, listdir, chmod
from os.path import join, abspath
from subprocess import call
from glob import glob
import re
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Greg Caporaso", "Kyle Bittinger"]
__license__ = "GPL"
__version__ = "1.5.0-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporaso@gmail.com"
__status__ = "Development"
long_description = """QIIME: Quantitative Insights Into Microbial Ecology
http://www.qiime.org
QIIME Allows Integration and Analysis of High-Throughput Community Sequencing Data
J. Gregory Caporaso, Justin Kuczynski, Jesse Stombaugh, Kyle Bittinger, Frederic D. Bushman, Elizabeth K. Costello, Noah Fierer, Antonio Gonzalez Pena, Julia K. Goodrich, Jeffrey I. Gordon, Gavin A. Huttley, Scott T. Kelley, Dan Knights, Jeremy E. Koenig, Ruth E. Ley, Cathy A. Lozupone, Daniel McDonald, Brian D. Muegge, Meg Pirrung, Jens Reeder, Joel R. Sevinsky, Peter J. Turnbaugh, William van Treuren, William A. Walters, Jeremy Widmann, Tanya Yatsunenko, Jesse Zaneveld and Rob Knight.
Nature Methods, 2010.
"""
doc_imports_failed = False
try:
import sphinx
except ImportError:
doc_imports_failed = True
try:
import cogent
except ImportError:
print "PyCogent not installed but required. (Is it installed? Is it in the current user's $PYTHONPATH or site-packages?) See http://pycogent.sourceforge.net."
exit(1)
from cogent.util.misc import app_path
def build_html():
""" Build the sphinx documentation
The code for building sphinx documentation is based on
PyCogent's setup.py.
"""
cwd = getcwd()
doc_dir = join(cwd,'doc')
chdir(doc_dir)
call(["make", "html"])
chdir(cwd)
index_html_path = join(abspath(doc_dir),'_build','html','index.html')
print "Local documentation built with Sphinx. "+\
"Open to following path with a web browser:\n%s" %\
index_html_path
def build_denoiser():
""" Build the denoiser code binary """
cwd = getcwd()
denoiser_dir = join(cwd,'qiime/support_files/denoiser/FlowgramAlignment')
chdir(denoiser_dir)
call(["make"])
chdir(cwd)
print "Denoiser built."
pycogent_version = tuple([int(v) \
for v in re.split("[^\d]", cogent.__version__) if v.isdigit()])
if pycogent_version < (1,5):
print "PyCogent >= 1.5.0 required, but %s is installed." % cogent.__version__
exit(1)
if app_path("ghc"):
build_denoiser()
else:
print "GHC not installed, so cannot build the Denoiser binary."
setup(name='QIIME',
version=__version__,
description='Quantitative Insights Into Microbial Ecology',
author=__maintainer__,
author_email=__email__,
maintainer=__maintainer__,
maintainer_email=__email__,
url='http://www.qiime.org',
packages=['qiime','qiime/parallel','qiime/pycogent_backports','qiime/denoiser'],
scripts=glob('scripts/*py')+glob('scripts/ec2*'),
package_data={'qiime':\
['support_files/qiime_config',\
'support_files/css/*css',\
'support_files/html_templates/*html',\
'support_files/images/*png',\
'support_files/jar/*jar',\
'support_files/js/*js',\
'support_files/R/*r',
'support_files/denoiser/Data/*',
'support_files/denoiser/TestData/*']},
data_files=[('qiime/support_files/denoiser/bin/',
['qiime/support_files/denoiser/FlowgramAlignment/FlowgramAli_4frame'])],
long_description=long_description,
)
if doc_imports_failed:
print "Sphinx not installed, so cannot build local html documentation."
else:
build_html()