Skip to content

Add ninja to Python build requirements #29740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

dstansby
Copy link
Member

@dstansby dstansby commented Mar 12, 2025

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

@github-actions github-actions bot added the CI: Run cygwin Run cygwin tests on a PR label Mar 12, 2025
@dstansby dstansby changed the title Add ninja to build requirements Add ninja to Python build requirements Mar 12, 2025
@timhoffm
Copy link
Member

Should this also be added to https://github.com/matplotlib/matplotlib/blob/main/environment.yml?

@story645
Copy link
Member

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

@dstansby
Copy link
Member Author

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.

@dstansby dstansby marked this pull request as draft March 13, 2025 10:33
@tacaswell
Copy link
Member

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 pixi.toml in the repo and start driving the default development workflow through pixi + CF which gets us away from wheels altogether.

@dstansby
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Run cygwin Run cygwin tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error finding "ninja" when setting up development environment
4 participants