Add ninja to Python build requirements#29740
Add ninja to Python build requirements#29740dstansby wants to merge 3 commits intomatplotlib:mainfrom
Conversation
|
Should this also be added to https://github.com/matplotlib/matplotlib/blob/main/environment.yml? |
|
It's complicated b/c this should optimally be provided by the system - sorry dropped the ball on #29083 for where/how this should be documented |
|
Ah, sorry I didn't see that! What's the reason for preferring a system-based install over a Python package? I had a quick look in the Python package and original package docs, and coudln't find anything on the topic. |
|
It is always a build requirement, but if you let pip use an isolated environment there is same magic that gets down to add ninja if it not available. pip/wheel does not claim to be (or I think want to be) a general purpose package manager (despite it being true you can wrap binaries up in a wheel and put them on pypi (like uv, ruff, ninja, cmake, even different versions of Python) but rather to be a package manager for Python packages. We should try to take the tools at their intent and prefer getting ninja from the system when possible. If pypa were to go the other way and try to become a general package manager then it would make sense to pull ninja + cmake + compilers from pypi, but until then I think we should prefer to get build tools from the system. It would also make sense (as described in #29746 ) to add a |
|
Thanks for the explanation - that makes sense. I might take a stab at a pixi development workflow then, especially since it's the only way I can get around #29741 at the moment. |
PR summary
At least for me in a clean virtual environment on macOS, this seems to be a build requirement. Fixes #29739.
I'm also hoping this means it doesn't need to be installed through system package managers on CI too, allowing it to be specified in one place instead of lots of places in the CI config.
PR checklist