I want to caution about using `pip install -e .` to get a development
install of numpy. This will work fine working on numpy itself, but won’t be
useful if you need to use the development version of numpy to build another
library. This doesn’t work because in-place installs don’t install the
numpy headers (arguably it was a bug that the old setuptools install did)
into the git repo, so the include paths `np.get_include()` reports won’t be
correct.

See this meson-python issue:
https://github.com/mesonbuild/meson-python/issues/429

For my work I tend to use a persistent build directory with build isolation
disabled as discussed in the meson-python docs. This gives me fast rebuilds
without using an in-place build. It does mean there’s a build and install
step when you edit python code in numpy that would otherwise be unnecessary
and sometimes the cache can go stale for reasons that aren’t totally
obvious.

In principle numpy could fix this by ensuring the headers get generated in
the git repo in the place they’re supposed to be installed. I have no idea
how hard it would be beyond that it would definitely require messing with
the codegen scripts.

On Sun, Nov 26, 2023 at 10:53 AM Stefan van der Walt via NumPy-Discussion <
numpy-discussion@python.org> wrote:

> Hi Doug,
>
> On Sun, Nov 26, 2023, at 06:29, Doug Turnbull wrote:
>
> To debug, I ran `pip install . --no-build-isolation` it worked (using
> venv's numpy)
>
>
> When developing NumPy, we typically build in the existing environment.
> This is done either via `pip install -e .` (which installs hooks to trigger
> a re-compile upon import), or via the spin tool (
> https://github.com/scientific-python/spin), which have meson commands
> pre-bundled:
>
> pip install spin
> spin  # lists commands available
>
> Best regards,
> Stéfan
>
> _______________________________________________
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: nathan12...@gmail.com
>
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to