-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
executable file
·46 lines (33 loc) · 973 Bytes
/
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
#!/usr/bin/env python3
import glob
from setuptools import setup # type: ignore
from pybind11.setup_helpers import Pybind11Extension, ParallelCompile
def source_files():
sources = glob.glob("src/*.cpp")
# can't use compile skips as some files are auto-generated
skip = ["RcppExports.cpp", "rcpp_api.cpp"]
for s in skip:
sources = [f for f in sources if s not in f]
return sources
def header_files():
return glob.glob("src/*.h")
def defines():
return [("PYTHON_MODULE", None)]
ext_modules = [
Pybind11Extension(
"_humanleague",
sources=source_files(),
include_dirs=["src"],
define_macros=defines(),
depends=["setup.py", "src/docstr.inl"] + header_files(),
cxx_std=20,
)
]
ParallelCompile().install()
setup(
name="humanleague",
packages=["humanleague"],
package_data={"humanleague": ["py.typed", "*.pyi"]},
ext_modules=ext_modules,
zip_safe=False,
)