Skip to content

Commit e06e19b

Browse files
committed
Build: Fix missing NumPy include
1 parent fe10e07 commit e06e19b

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools"]
2+
requires = ["setuptools", "numpy"]
33
build-backend = "setuptools.build_meta"
44

55
[project]

setup.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
from setuptools import setup
2+
from setuptools.command.build_ext import build_ext
23

3-
setup()
4+
5+
class build_ext_with_numpy(build_ext):
6+
def build_extensions(self):
7+
import numpy
8+
9+
numpy_include = numpy.get_include()
10+
for ext in self.extensions:
11+
ext.include_dirs.append(numpy_include)
12+
13+
super().build_extensions()
14+
15+
16+
setup(cmdclass={"build_ext": build_ext_with_numpy})

0 commit comments

Comments
 (0)