forked from chonkie-inc/chonkie
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
32 lines (27 loc) · 904 Bytes
/
setup.py
File metadata and controls
32 lines (27 loc) · 904 Bytes
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
"""Setup script for Chonkie's Cython extensions.
This script configures the Cython extensions used in the Chonkie library.
It includes the token_chunker, split, merge, and NumPy-free Savitzky-Golay extensions.
"""
import os
from Cython.Build import cythonize
from setuptools import Extension, setup
# Get the c_extensions directory
c_extensions_dir = os.path.join("src", "chonkie", "chunker", "c_extensions")
extensions = [
Extension(
"chonkie.chunker.c_extensions.split",
[os.path.join(c_extensions_dir, "split.pyx")],
),
Extension(
"chonkie.chunker.c_extensions.merge",
[os.path.join(c_extensions_dir, "merge.pyx")],
),
Extension(
"chonkie.chunker.c_extensions.savgol",
[os.path.join(c_extensions_dir, "savgol.pyx")],
extra_compile_args=["-O3"],
),
]
setup(
ext_modules=cythonize(extensions, language_level=3),
)