esutil icon indicating copy to clipboard operation
esutil copied to clipboard

A bit hacky way of forcing numpy to be installed

Open karpov-sv opened this issue 2 years ago • 4 comments

prior to main body of setup.py so that it may use numpy.get_include()

It seems there is no "official" way to do it - see e.g. https://stackoverflow.com/questions/54117786/add-numpy-get-include-argument-to-setuptools-without-preinstalled-numpy (the solution is borrowed from that thread)

karpov-sv avatar Jun 02 '22 23:06 karpov-sv

I think the correct way to have numpy available at install time is to include a pyproject.toml file with

[build-system]
requires = ["setuptools","wheel","numpy"]

and then you can just keep using the current setup.py (I think, haven't tested this specific case). I think you then have to install with pip (e.g., pip install -e . for an editable install), but I'm not sure.

jobovy avatar Jun 03 '22 00:06 jobovy

Exactly - it will not work with python setup.py install installation method anymore, which is a bit counter-intuitive I think.

karpov-sv avatar Jun 03 '22 05:06 karpov-sv

Exactly - it will not work with python setup.py install installation method anymore, which is a bit counter-intuitive I think.

Perhaps counter-intuitive, but you're not supposed to use python setup.py install anymore, setuptools' own page doesn't even mention python setup.py install anymore. One is not supposed to even assume that setuptools is installed on a system, so technically packages without a pyproject.toml can't be installed reliably on all systems.

jobovy avatar Jun 03 '22 14:06 jobovy

This was superseded by #77, so this could be closed.

jobovy avatar Aug 23 '23 00:08 jobovy