-
Notifications
You must be signed in to change notification settings - Fork 17
/
setup.py
executable file
·124 lines (102 loc) · 3.66 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2019--, gemelli 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.command.egg_info import egg_info
from setuptools.command.develop import develop
from setuptools.command.install import install
import re
import ast
import os
from setuptools import find_packages, setup
# Dealing with Cython
USE_CYTHON = os.environ.get('USE_CYTHON', False)
ext = '.pyx' if USE_CYTHON else '.c'
# bootstrap numpy intall
# https://stackoverflow.com/questions/51546255/
# python-package-setup-setup-py-with-customisation
# -to-handle-wrapped-fortran
def custom_command():
import sys
if sys.platform in ['darwin', 'linux']:
os.system('pip install numpy')
class CustomInstallCommand(install):
def run(self):
install.run(self)
custom_command()
class CustomDevelopCommand(develop):
def run(self):
develop.run(self)
custom_command()
class CustomEggInfoCommand(egg_info):
def run(self):
egg_info.run(self)
custom_command()
extensions = [
]
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
classes = """
Development Status :: 3 - Alpha
License :: OSI Approved :: BSD License
Topic :: Software Development :: Libraries
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Bio-Informatics
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Operating System :: Unix
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
"""
classifiers = [s.strip() for s in classes.split('\n') if s]
description = ('Robust Aitchison Tensor Decomposition for sparse count data')
with open('README.md') as f:
long_description = f.read()
# version parsing from __init__ pulled from Flask's setup.py
# https://github.com/mitsuhiko/flask/blob/master/setup.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('gemelli/__init__.py', 'rb') as f:
hit = _version_re.search(f.read().decode('utf-8')).group(1)
version = str(ast.literal_eval(hit))
standalone = ['gemelli=gemelli.scripts.__init__:cli']
q2cmds = ['q2-gemelli=gemelli.q2.plugin_setup:plugin']
setup(name='gemelli',
version=version,
license='BSD-3-Clause',
description=description,
long_description=long_description,
long_description_content_type='text/markdown',
author="gemelli development team",
author_email="[email protected]",
maintainer="gemelli development team",
maintainer_email="[email protected]",
packages=find_packages(),
ext_modules=extensions,
install_requires=[
'numpy >= 1.12.1',
'click',
'pandas >= 0.10.0',
'scipy >= 0.19.1',
'nose >= 1.3.7',
'scikit-learn >= 0.18.1',
'scikit-bio > 0.5.3',
'biom-format',
'h5py',
'iow',
'tax2tree'],
classifiers=classifiers,
entry_points={'qiime2.plugins': q2cmds,
'console_scripts': standalone},
# Inclusion of citations.bib in package_data based on how this is done in
# q2-emperor's setup.py file
package_data={'gemelli': ['citations.bib',
'q2/qc_assests/*.html']},
cmdclass={'install': CustomInstallCommand,
'develop': CustomDevelopCommand,
'egg_info': CustomEggInfoCommand, },
zip_safe=False)