forked from scikit-hep/boost-histogram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
68 lines (56 loc) · 1.73 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
import os
import sys
from pathlib import Path
from setuptools import setup
DIR = Path(__file__).parent.resolve()
sys.path.append(str(DIR / "extern" / "pybind11"))
from pybind11.setup_helpers import ParallelCompile, Pybind11Extension # noqa: E402
del sys.path[-1]
# Use the environment variable CMAKE_BUILD_PARALLEL_LEVEL to control parallel builds
ParallelCompile("CMAKE_BUILD_PARALLEL_LEVEL").install()
cxx_std = int(os.environ.get("CMAKE_CXX_STANDARD", "14"))
SRC_FILES = [
"src/module.cpp",
"src/register_accumulators.cpp",
"src/register_algorithm.cpp",
"src/register_axis.cpp",
"src/register_histograms.cpp",
"src/register_storage.cpp",
"src/register_transforms.cpp",
]
INCLUDE_DIRS = [
"include",
"extern/pybind11/include",
"extern/assert/include",
"extern/config/include",
"extern/core/include",
"extern/histogram/include",
"extern/mp11/include",
"extern/throw_exception/include",
"extern/variant2/include",
]
ext_modules = [
Pybind11Extension(
"boost_histogram._core",
SRC_FILES,
include_dirs=INCLUDE_DIRS,
cxx_std=cxx_std,
include_pybind11=False,
extra_compile_args=["/d2FH4-"] if sys.platform.startswith("win32") else [],
)
]
extras = {
"test": ["pytest>=6.0", "pytest-benchmark", "cloudpickle", "hypothesis>=6.0"],
"docs": [
"Sphinx>=4.0",
"myst_parser>=0.13",
"sphinx-book-theme>=0.0.33",
"nbsphinx",
"sphinx_copybutton",
],
"examples": ["matplotlib", "xarray", "xhistogram", "netCDF4", "numba", "uproot3"],
"dev": ["ipykernel", "typer"],
}
extras["all"] = sum(extras.values(), [])
extras["dev"] += extras["test"]
setup(ext_modules=ext_modules, extras_require=extras)