You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BLD: migrate requirements/*.txt to [dependency-groups] in pyproject.toml #24670
This follows up on this comment from @skirpichev: #23808 (comment) about f2py -c needing meson and ninja for Python 3.12 (or with --backend=meson on older Python versions).
In numpy it could have an extra f2py section, and that would allow installing the needed dependencies with pip install numpy[f2py]. Of course you have to know that that's possible, and at that point you can equally well do pip install meson ninja , so this isn't all that urgent. An extra complication is that ninja is a system dependency, and using it from PyPI is a bit hacky. That's for example why meson and meson-python do not have a direct dependency on ninja; meson-python first checks if it's installed on the system and dynamically adds it in non-isolated installs if it's missing.
I'd say we don't want to do this for 1.26.0, but we can consider populating the optional dependencies table for 2.0.
I'm bumping this to the next release cycle, because I don't want to touch optional dependencies right before creating a release branch, and this isn't blocking/important for 2.0
We discussed this a triage meeting and decided to remove it from the milestone, but it would be nice to have this, as well as #26289 to ship tests separately.
@rgommers We discussed this at today's community meeting, and the consensus was that we should definitely pursue it. The scope would be adding [dependency-groups] (PEP 735) in addition to [project.optional-dependencies].
Are you still planning to work on this task? If not, I'd be happy to take it on.
Dependency groups are excellent. scipy has gone down this route and it's working well. As this proceeds it needs to go hand in hand with removing all of the requirements.txt files.
Reacted by Inessa Pawson, Matti Picus, Joren Hammudoglu and Ralf Gommers
changed the title [-]Consider populating `optional-dependencies` in pyproject.toml[/-][+]BLD: migrate requirements/*.txt to [dependency-groups] in pyproject.toml[/+]on Oct 8, 2026
I have a question about the existing requirements files. A lot of them, such as pytest, have specific version pins without comments as to why they're pinned. Are the pins work arounds, or there for another reason?
some of the pins are to prevent the fast release cycles from causing churn in NumPy as the library developers change the APIs and deprecate parts we use. For instance #31635, maybe there are others.
Activity
rgommers commentedon Jan 31, 2024
I'm bumping this to the next release cycle, because I don't want to touch optional dependencies right before creating a release branch, and this isn't blocking/important for 2.0
mattip commentedon Aug 7, 2024
This would be good to do, it would require some knowledge of packaging and maybe meson.
mattip commentedon Aug 21, 2024
We discussed this a triage meeting and decided to remove it from the milestone, but it would be nice to have this, as well as #26289 to ship tests separately.
InessaPawson commentedon Oct 7, 2026
@rgommers We discussed this at today's community meeting, and the consensus was that we should definitely pursue it. The scope would be adding
[dependency-groups](PEP 735) in addition to[project.optional-dependencies].Are you still planning to work on this task? If not, I'd be happy to take it on.
andyfaff commentedon Oct 8, 2026
Dependency groups are excellent. scipy has gone down this route and it's working well. As this proceeds it needs to go hand in hand with removing all of the requirements.txt files.
rgommers commentedon Oct 8, 2026
+1 to what Andrew said. No need for
optional-dependenciesanymore, I don't think we have any. The goal of getting rid of everything in https://github.com/numpy/numpy/tree/main/requirements is unchanged, but it can now be migrated todependency-groupsinstead.InessaPawson commentedon Oct 8, 2026
@rgommers Thank you for clarifying the scope on this issue! Let me know if you need help.
[-]Consider populating `optional-dependencies` in pyproject.toml[/-][+]BLD: migrate requirements/*.txt to [dependency-groups] in pyproject.toml[/+]andyfaff commentedon Oct 8, 2026
I have a question about the existing requirements files. A lot of them, such as pytest, have specific version pins without comments as to why they're pinned. Are the pins work arounds, or there for another reason?
mattip commentedon Oct 8, 2026
some of the pins are to prevent the fast release cycles from causing churn in NumPy as the library developers change the APIs and deprecate parts we use. For instance #31635, maybe there are others.
ikrommyd commentedon Oct 9, 2026
+100 on this from me. Dependency groups are way nicer than requirement txt files.
seberg commentedon Oct 21, 2026
I guess these are all gone now, so closing :)