-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
88 lines (70 loc) · 2.15 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
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
from glob import glob
import os
import subprocess
import sys
try:
from pybind11.setup_helpers import Pybind11Extension, ParallelCompile, naive_recompile
ParallelCompile("NPY_NUM_BUILD_JOBS", default=4, needs_recompile=naive_recompile).install()
except:
from setuptools import Extension as Pybind11Extension
about = {}
with open("src/uncalled4/__about__.py") as fp:
exec(fp.read(), about)
ROOT_DIR = os.getcwd()
class get_pybind_include(object):
"""Helper class to determine the pybind11 include path
The purpose of this class is to postpone importing pybind11
until it is actually installed, so that the ``get_include()``
method can be invoked. """
def __str__(self):
import pybind11
from pybind11.setup_helpers import Pybind11Extension
return pybind11.get_include()
uncalled4_cpp = Pybind11Extension(
"_uncalled4",
sources = glob("src/cpp/**.cpp", recursive=True),
include_dirs = [
get_pybind_include(), "./src/cpp/"
],
libraries = ["z", "dl", "m"],
extra_compile_args = ["-std=c++11", "-O3", "-g"],
define_macros = [("PYBIND", None)]#, ("PYDEBUG", None)]
)
requires=[
'pybind11>=2.6.0',
'pandas>=1.1.5',
'plotly>=5.0.0',
'dash>=2.0.0',
'scipy>=1.5.4',
'toml>=0.10.2',
'ont_fast5_api',
'pysam',
'pyslow5',
'pod5',
'tblib'
],
setup(
name = about["__title__"],
version = about["__version__"],
description = about["__summary__"][0],
author = about["__author__"],
author_email = about["__email__"],
url = about["__uri__"],
build_backend = "setuptools.build_meta",
classifiers=[
"Programming Language :: Python :: 3"
],
python_requires=">=3.8",
setup_requires=['setuptools', 'pybind11>=2.6.0'],
install_requires=requires,
packages=find_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
ext_modules = [uncalled4_cpp],
#cmdclass={'build_ext': pre_build},
entry_points = {
'console_scripts' : ['uncalled4=uncalled4.__main__:main'],
}
)