-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup.py
60 lines (49 loc) · 1.69 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
#!/usr/bin/env python
from setuptools import setup, find_packages
from setuptools.extension import Extension
import sys
if sys.version_info < (3, 3):
raise RuntimeError("Python version >= 3.3 required.")
def get_version(string):
""" Parse the version number variable __version__ from a script. """
import re
version_re = r"^__version__ = ['\"]([^'\"]*)['\"]"
version_str = re.search(version_re, string, re.M).group(1)
return version_str
def get_includes():
class Includes:
def __iter__(self):
import pysam
import numpy
return iter(pysam.get_include()+[numpy.get_include()])
def __getitem__(self, i):
return list(self)[i]
return Includes()
def get_defines():
class Defines:
def __iter__(self):
import pysam
return iter(pysam.get_defines())
def __getitem__(self, i):
return list(self)[i]
return Defines()
extensions = [
Extension("svviz2.remap._mapq",
sources=["src/svviz2/remap/_mapq.pyx"],
include_dirs=get_includes(),
define_macros=get_defines()
)
]
setup(name="svviz2",
version=get_version(open('src/svviz2/__init__.py').read()),
description="svviz2",
author="Noah Spies",
packages = find_packages("src"),
package_dir = {"": "src"},
ext_modules = extensions,
setup_requires=["cython<3.0"],
entry_points={"console_scripts": ["svviz2 = svviz2.app.main:main"]},
install_requires=["pysam>=0.10", "numpy>=1.11.1", "pyfaidx", "tqdm", "pandas", "numpy",
"seqlib>=0.0.6", "genomeview"],
python_requires=">=3.3"
)