forked from tanghaibao/jcvi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
77 lines (67 loc) · 2.17 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
#!/usr/bin/env python
from __future__ import absolute_import
import os.path as op
import versioneer
from setuptools import setup, find_packages, Extension
from setup_helper import SetupHelper
name = "jcvi"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
# Use the helper
h = SetupHelper(initfile="jcvi/__init__.py", readmefile="README.md")
h.check_version(name, majorv=2, minorv=7)
cmdclass = versioneer.get_cmdclass()
include_dirs = []
setup_dir = op.abspath(op.dirname(__file__))
requirements = [x.strip() for x in open(op.join(setup_dir, "requirements.txt"))]
h.install_requirements(requires=["cython", "numpy"])
# Build the ext
try:
import numpy as np
from Cython.Distutils import build_ext
cmdclass.update({"build_ext": build_ext})
include_dirs.append(np.get_include())
except ImportError:
print("Cython not installed. Skip compiling Cython extensions.")
ext_modules = [
Extension(
"jcvi.assembly.chic",
["jcvi/assembly/chic.pyx"],
include_dirs=include_dirs,
extra_compile_args=["-O3"],
),
Extension(
"jcvi.formats.cblast", ["jcvi/formats/cblast.pyx"], extra_compile_args=["-O3"]
),
]
packages = [name] + [
".".join((name, x)) for x in find_packages("jcvi", exclude=["test*.py"])
]
setup(
name=name,
author=h.author,
author_email=h.email,
version=versioneer.get_version(),
license=h.license,
long_description=h.long_description,
long_description_content_type="text/markdown",
cmdclass=cmdclass,
packages=packages,
include_package_data=True,
package_data={"jcvi.utils.data": ["*.*"]},
ext_modules=ext_modules,
classifiers=classifiers,
zip_safe=False,
url="http://github.com/tanghaibao/jcvi",
description="Python utility libraries on genome assembly, "
"annotation and comparative genomics",
setup_requires=["setuptools>=18.0", "cython"],
install_requires=requirements,
)