Skip to content

Commit

Permalink
Revert "maybe fix setup.py ModuleNotFoundError: No module named 'numpy'"
Browse files Browse the repository at this point in the history
This reverts commit 45a1fd7.
  • Loading branch information
DanielYang59 committed Sep 11, 2024
1 parent b8f6cfa commit e4ceb6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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()],
)

0 comments on commit e4ceb6a

Please sign in to comment.