On Sun, Nov 26, 2023 at 9:06 PM Nathan <nathan.goldb...@gmail.com> wrote:

> 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.
>

This sounds about right - editable installs are only useful for working on
`numpy` itself, and perhaps basic pure Python packages on top. But editable
installs are fundamentally not complete installs, and should not be used
for developing a set of packages together that depend on each other. I'll
note that there's an active discussion (PEP 735 draft) which touched on a
"workspaces" concept for this.

Also, please do not ever use editable installs without
`--no-build-isolation`, that may lead to weird issues.

Cheers,
Ralf



>
> 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: ralf.gomm...@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