-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
51 lines (42 loc) · 1.17 KB
/
setup.py
File metadata and controls
51 lines (42 loc) · 1.17 KB
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
"""
File: /setup.py
Created Date: Wednesday July 30th 2025
Author: Christian Nonis <alch.infoemail@gmail.com>
-----
Last Modified: Wednesday July 30th 2025 9:36:09 pm
Modified By: the developer formerly known as Christian Nonis at <alch.infoemail@gmail.com>
-----
"""
from setuptools import setup, Extension, find_packages
def get_pybind11_include():
"""Get pybind11 include directory, handling import issues."""
try:
import pybind11
return pybind11.get_include()
except ImportError:
return "/placeholder/pybind11/include"
except AttributeError:
try:
from pybind11 import get_include
return get_include()
except ImportError:
return "/placeholder/pybind11/include"
pybind11_include = get_pybind11_include()
ext_modules = [
Extension(
"chunker_cpp",
["main.cpp", "chunker/chunker.cpp"],
include_dirs=[pybind11_include, "chunker"],
language="c++",
extra_compile_args=["-std=c++17"],
),
]
setup(
ext_modules=ext_modules,
packages=find_packages(),
py_modules=["chunker"],
package_data={
"": ["*.pyi"],
},
zip_safe=False,
)