nikolasibalic / ARC-Alkali-Rydberg-Calculator

Object-oriented Python library for computation of properties of highly-excited Rydbeg states of alkali and divalent atoms.
https://atomcalc.org
BSD 3-Clause "New" or "Revised" License
86 stars 72 forks source link

Ensure that Numpy is installed before it is referenced. #115

Closed paul-romlow closed 1 year ago

paul-romlow commented 2 years ago

When installing to an environment that does not have Numpy installed, the build fails. This waits to reference Numpy until after the setup_requires section has been resolved.

nikolasibalic commented 2 years ago

HI @paul-romlow

Thank you for contribution. I have just one question trying to understand use-case. Usually the dependencies that are needed are installed via requirements.txt. This is done automatically when you do pip install. How did you do installation to run into this problem? Maybe you had some reason why you couldn't run pip install ?

paul-romlow commented 2 years ago

We use Pants for a build system which creates a virtual environment first and then it builds the source (Linux, so no binary available) before installing all of the other requirements. https://www.pantsbuild.org/

Here's an example that is easy to reproduce:

paul@hostname:\~/src/ARC-Alkali-Rydberg-Calculator$ python -m venv arcenv paul@hostname:\~/src/ARC-Alkali-Rydberg-Calculator$ source arcenv/bin/activate (arcenv) paul@hostnamex:\~/src/ARC-Alkali-Rydberg-Calculator$ python setup.py bdist_wheel Traceback (most recent call last): File "setup.py", line 10, in from numpy.distutils.misc_util import get_numpy_include_dirs ModuleNotFoundError: No module named 'numpy'

paul-romlow commented 1 year ago

If this PR is not acceptable to you, would it be possible for you to publish a wheel (bdist_wheel) for amd64 Linux as is done with Windows and MacOS? I'd be happy to help with getting that set up, please let me know.

Thanks!

nikolasibalic commented 1 year ago

@paul-romlow Please check if the above change is fine with you. If so, commit update, and I will accept this PR and release a new version.