diff --git a/pyproject.toml b/pyproject.toml index f362e701..18419c01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,12 @@ find = { include = ["chgnet*"], exclude = ["tests", "tests*"] } "chgnet.pretrained" = ["*", "**/*"] [build-system] -requires = ["Cython", "numpy>=2", "setuptools>=65", "wheel"] +requires = [ + "Cython", + "setuptools>=65", + "wheel", + "numpy>=2.0.0", +] build-backend = "setuptools.build_meta" [tool.ruff] diff --git a/setup.py b/setup.py index e01c2685..ab494d5a 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,12 @@ from __future__ import annotations +import numpy as np from setuptools import Extension, setup ext_modules = [Extension("chgnet.graph.cygraph", ["chgnet/graph/cygraph.pyx"])] - -def lazy_numpy_include() -> str: - """Get the numpy include directory lazily.""" - import numpy as np - - return np.get_include() - - setup( ext_modules=ext_modules, setup_requires=["Cython"], - include_dirs=[lazy_numpy_include()], + include_dirs=[np.get_include()], )