Skip to content

Commit

Permalink
refine setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
juaduan committed Jul 8, 2024
1 parent e74ae63 commit 098e429
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@

from setuptools import setup, Extension
from Cython.Build import cythonize

class GetNumpyInclude(object):
"""A lazy include path for numpy.
This way numpy isn't imported until it's actually installed,
so the `install_requires` argument can handle it properly.
"""
def __str__(self):
import numpy
return numpy.get_include()
import numpy as np


if __name__ == "__main__":
extensions = [
Extension(
"anomaly_detector.univariate._anomaly_kernel_cython",
["src/anomaly_detector/univariate/_anomaly_kernel_cython.pyx"],
include_dirs=[GetNumpyInclude()]
include_dirs=[np.get_include()]
)
]

Expand Down

0 comments on commit 098e429

Please sign in to comment.