-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
127 lines (102 loc) · 3.4 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
125
126
127
#!/usr/bin/env python
"""
Build script for the skytether module. This includes how to compile cython bindings for skyhook.
"""
# ------------------------------
# Dependencies
# >> Modules
import os
# >> Third-party
import numpy
import pyarrow
# >> Classes
from setuptools import Extension
# >> Functions
from setuptools import setup
from Cython.Build import cythonize
# ------------------------------
# Module variables
# >> reference variables
kinetic_installdir = os.path.join('/opt', 'kinetic')
skytether_installdir = os.path.join('/opt', 'skytether-singlecell')
cpp_srcdirpath = os.path.join('src', 'cpp')
py_srcdirpath = os.path.join('src', 'python')
pkg_srcdirpath = os.path.join(py_srcdirpath, 'skytether', 'cybindings')
scytether_srclist = [
os.path.join(pkg_srcdirpath, 'scytether.pyx')
# ,os.path.join(pkg_srcdirpath, 'cykinetic.pyx')
,os.path.join(cpp_srcdirpath, 'storage' , 'skykinetic.cpp')
]
# cykinetic_srclist = [
# os.path.join(pkg_srcdirpath, 'cykinetic.pyx')
# ,os.path.join(cpp_srcdirpath, 'storage' , 'skykinetic.cpp')
# ]
skytether_inclist = [
numpy.get_include()
,pyarrow.get_include()
,os.path.join(kinetic_installdir , 'include')
,os.path.join(skytether_installdir, 'include')
]
skytether_liblist = [
'arrow'
,'arrow_dataset'
,'arrow_python'
,'skytether'
]
skytether_libdirs = (
[
'/usr/lib'
,os.path.join(skytether_installdir, 'lib')
]
+ pyarrow.get_library_dirs()
)
# >> cython extension by source list
scytether_extension = Extension('scytether'
,scytether_srclist
,include_dirs=skytether_inclist
,library_dirs=skytether_libdirs
,libraries=skytether_liblist
)
# cykinetic_extension = Extension('cykinetic'
# ,cykinetic_srclist
# ,include_dirs=skytether_inclist
# ,library_dirs=skytether_libdirs
# ,libraries=skytether_liblist
# )
# ------------------------------
# Main build logic
with open('README.md', mode='r', encoding='utf-8') as readme_handle:
readme_content = readme_handle.read()
cythonize_modulelist = [ scytether_extension ]
# cythonize_modulelist = [ scytether_extension, cykinetic_extension ]
cythonize_compdirs = { 'language_level': 3 }
setup(
name = 'skytether'
,version = '0.1.0'
,zip_safe = False
,author = 'Aldrin Montana'
,author_email = '[email protected]'
,description = ('SkyhookDM for single-cell use cases')
,license = 'MPL 2.0'
,keywords = 'example documentation tutorial'
,url = 'https://gitlab.com/skyhookdm/skytether-singlecell/'
,long_description = readme_content
,package_dir = { '': py_srcdirpath }
,packages = [ 'skytether', 'skytether.knowledge' ]
# ,packages = [ 'skytether', 'skytether.knowledge', 'skytether.cybindings' ]
# ,package_data = {
# 'skytether': [
# 'cybindings/scytether.pyx'
# ,'cybindings/cykinetic.pyx'
# ]
# }
,ext_modules = cythonize(
module_list=cythonize_modulelist
,compiler_directives=cythonize_compdirs
)
,classifiers = [
'Development Status :: 1 - Planning'
,'Topic :: Utilities'
,'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)'
]
)