zadorlab / sella

A Python software package for saddle point optimization and minimization of atomic systems.
https://www.ecc-project.org/
Other
72 stars 20 forks source link

Bootstrap numpy installation in setup.py #7

Closed mist714 closed 3 years ago

mist714 commented 3 years ago

In an empty Python environment, pip install sella will fail because we are importing numpy in setup.py.

python -m venv sella
source sella/bin/activate

Then, pip install sella fails with ModuleNotFoundError: No module named 'numpy'.

In this PR, we will add numpy to setup_requires so that we can install sella even in an empty python environment. Also, use build_context to import numpy lazily. I referenced following page for implementation. https://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py