-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·70 lines (57 loc) · 1.87 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
import os
from setuptools import setup, find_packages
from setuptools.extension import Extension
def pip_install(pkg_name):
import subprocess
subprocess.check_call(
["python", "-m", "pip", "install", pkg_name], stdout=subprocess.DEVNULL
)
try:
from Cython.Build import cythonize
from Cython.Distutils import build_ext
except ImportError:
pip_install("cython")
from Cython.Build import cythonize
from Cython.Distutils import build_ext
class BuildExt(build_ext):
def build_extensions(self):
if "-Wstrict-prototypes" in self.compiler.compiler_so:
self.compiler.compiler_so.remove("-Wstrict-prototypes")
super().build_extensions()
extensions = [
Extension(
"variantpost.__search",
[
"variantpost/__search.pyx",
"variantpost/contig.cpp",
"variantpost/eval.cpp",
"variantpost/search.cpp",
"variantpost/reads.cpp",
"variantpost/match.cpp",
"variantpost/merge.cpp",
"variantpost/util.cpp",
"variantpost/substitutes.cpp",
"variantpost/similarity.cpp",
"variantpost/ssw/ssw.c",
"variantpost/ssw/ssw_cpp.cpp",
"variantpost/fasta/Fasta.cpp",
"variantpost/fasta/split.cpp",
],
language="c++",
extra_compile_args=["-std=c++17"],
#extra_compile_args=["-O3", "-std=c++17"],
extra_link_args=["-std=c++17"],
#extra_link_args=["-O3", "-std=c++17"],
),
]
version = {}
with open("variantpost/version.py") as ver:
exec(ver.read(), version)
setup(
name="variantpost",
version=version["__version__"],
packages=find_packages(exclude=["tests"]),
cmdclass={"build_ext": BuildExt},
ext_modules=cythonize(extensions, annotate=False, language_level="3"),
install_requires=["pysam>=0.15.0"],
)