-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Add python-ninja #19098
Add python-ninja #19098
Conversation
Ninja is a small build system with a focus on speed. This is the Python build. Refer to https://github.com/scikit-build/ninja-python-distributions
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/python-ninja:
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Getting an error at https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=513324&view=logs&j=6f142865-96c3-535c-b7ea-873d86b887bd&t=22b0682d-ab9e-55d7-9c79-49f3c3ba4823&l=1749 like |
recipes/python-ninja/meta.yaml
Outdated
sha256: e1b86ad50d4e681a7dbdff05fc23bb52cb773edb90bc428efba33fa027738408 | ||
|
||
build: | ||
noarch: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot be noarch: python
if compiled extensions, like the ninja
executable are contained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @awvwgk, Ci tests all pass now 😃
recipe-maintainers: | ||
- weiji14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would anyone else like to be a maintainer for this python-ninja
recipe? Cc @Anthchirp
@conda-forge/help-python this PR is ready for review! One concern is that the |
I think it would be better to dependent on |
Agree, but I'm not sure exactly how to make that work 😅 Looking at https://github.com/conda-forge/meson-python-feedstock/blob/main/recipe/meta.yaml, it seems to just depend on |
|
RIght, I've just read #19033 and https://github.com/FFY00/meson-python/issues/60 and seem to understand the situation a bit better. Right now the dependency graph looks something like this (correct me if I'm wrong): graph LR;
ninja --> meson-python;
python-ninja-from-PyPI? --> meson-python;
ninja --> meson;
meson --> meson-python;
click ninja "https://github.com/conda-forge/ninja-feedstock" "Open this in a new tab" _blank
click meson-python "https://github.com/conda-forge/meson-python-feedstock" "Open this in a new tab" _blank
click meson "https://github.com/conda-forge/meson-feedstock" "Open this in a new tab" _blank
But after this PR, we want to make it look like this: graph LR;
ninja --> python-ninja-from-conda-forge;
python-ninja-from-conda-forge --> meson-python;
ninja --> meson;
meson --> meson-python;
click ninja "https://github.com/conda-forge/ninja-feedstock" "Open this in a new tab" _blank
click meson-python "https://github.com/conda-forge/meson-python-feedstock" "Open this in a new tab" _blank
click meson "https://github.com/conda-forge/meson-feedstock" "Open this in a new tab" _blank
Now my question is, how to make this current @henryiii, you mentioned at conda-forge/ninja-feedstock#27 (comment) that there's a way to make the PyPI-ninja work with an externally compiled Ninja? Could you advise on how? |
There is no
Ninja source code is fetched in CMake at: Compilation of the fetched source happens via Than the ninja binary is inferred heuristically and the install happens at: The CMake part however is irrelevant, because this has already been done in the which defines the search for the ninja binary using the the install location of the CMake build. I think this package cannot be added to conda-forge without patching out the CMake build and adjusting the way the |
Thanks @awvwgk for the detailed pointers! Unfortunately, I'm a little low on bandwidth this week (will be travelling soon and moving house) and might not have time for a few weeks to dig into the Cmake config. Happy for another maintainer to take over and push commits to this PR (or in a separate branch), or we could merge this PR as is, and let people can work on it in the feedstock repo. Either way, I'd appreciate a few more people being added to the recipe-maintainer list. Personally I'm not that familiar with |
Allowing both cmake and ninja Python packages to target an existing build is planned! Just haven't had a chance to work on it yet. I'll try to work on it next week. |
Looks like there's some discussion happening at scikit-build/ninja-python-distributions#127 on this matter. Let me know when things are sorted upstream and I can try to continue work on this conda-forge recipe 😃 |
Still planned, but very low priority, and making a large changes to the setup.py when I'm planning to get rid of it soon is probably not a great idea. :) |
My understanding is that But to do that I would like someone with experience using |
For discussion related to |
There should be (almost) no need to every have the ninja-python package. Ninja should be fine, with one exception. Anyone using ninja should try to use the system ninja if the Python package is present - then the ninja package in conda-forge would be fine. The only exception is the Python package is actually a Kitware fork of ninja that provides one extra feature - Jobserver support. If there's a conda package for ninja-python, it should include this forked version with jobserver. There is the issue that users put ninja in pyproject.toml's build requires, but conda ignores that, and it's the wrong solution; scikit-build-core & meson-python have implemented the correct solution - dynamically adding the dependency via PEP 517's hooks if there is not a sufficient system version. |
I'm a bit confused here as to what's going on exactly, but another data point: The
and yet:
NOTE: Given that pip installing works, I'm quite confused as to why we can't have a python-ninja conda package now -- even if it will get refactored soon. Also: the conda-forge ninja package doesn't install a
So is
But this isn't about Ninja itself, it's about other things that use the python package -- apparently: https://github.com/scikit-build/ninja-python-distributions (which looks like the kitware fork, yes)
I'm a bit confused here -- is the "system ninja" in the context of conda, the one that conda installed? The whole distinction between "system" and "local" is fuzzier with conda ... |
From pytype's source, it looks like they are correctly looking for a system ninja (I don't see an Do you know where the |
It doesn't? So what does it install, then? Given its entire rationale for existing is to install a
It's broken, yes. It's running People are using While that certainly does work, in the sense that it performs an action, it's been stated several times that it's the wrong kind of working. I think pytype will either need patching to revert that change, or else an upstream fix to try both. |
My mistake -- it doesn't install a working
I've posted an issue on that feedstock: conda-forge/ninja-feedstock#31 Hmm -- maybe it's not the pytype feedstock (or code) that's broken, it cold be the ninja feedstock is not providing a working ninja, so it's trying to revert to a python call. |
Huh? That ninja program works fine. It correctly runs, and attempts to parse the build file. Then it reports a well formatted error that the file it wants doesn't exist. It's like running |
OK, thanks -- my ignorance -- pytype is apparently broken then. I'll go close the ticket on the feedstock. -CHB |
conda-forge's pytype is broken-ish because it started needing the python-ninja recently (in the past six months or so, not sure when exactly). If you look in your PR, @PythonCHB, you will see right after your addition and I commented out the pip check because it would fail without this PR here. conda-forge/pytype-feedstock@main...PythonCHB:pytype-feedstock:main I contemplated stopping the frequent updates of pytype in conda-forge, but held back because I wasn't sure if people use the pytype package in different ways that they'd not be affected by this missing python-ninja. Happy to enable the Also, I recommend you open an issue upstream if this is affecting you. The main maintainer upstream is quite responsive, albeit a bit cautious and methodical in terms updates (e.g., python 3.11 is still not supported: conda-forge/pytype-feedstock#85) |
Yes, I saw that, but it's actually checking the wrong thing -- if this was all written built as it should be, then the pytype conda package would depend on the "real" ninja package, and even if pip still thinks it wants the python ninja package. So my PR actually checks if the pytype command works -- not if the pip dependencies are satisfied. That is, I suspect if pytype is fixed to use a system ninja, it may still show as a pip dependency, as they want "pip install" to "jsut work" for their users.
I have no idea -- i'm not a heavy pytype user, I only discovered this because I was checking it out for the first time, but I can tell you that it doesn't work for the very simplest of examples.
I would use my PR instead -- see above. But either way, I don't think dysfunctional pytype packages should be provided :-( By the way, I went back to a version over a year old, and it was broken then -- are you sure it ever worked?
I've done that, we'll see. On the other hand, if the pytype maintainers are committed to supporting only the pip-installed ninja, then we should probably supply that in conda-forge. I think they should vendor it if that's what they want, but they need to do what they think is best. |
I think it is pretty clear that python-ninja is required for pytype, see |
If you could help determine the last working version of pytype we have on conda-forge, then I will submit a PR to mark all those after it as "broken" to avoid providing a pytype that's broken or half broken. Thank you! |
Maybe conda-forge could provide a simple stub package |
As long as some conda-forge packages requires This is also problematic for deepspeed: conda-forge/deepspeed-feedstock#1 |
That is not the correct fix. This won't fix other non-conda packaging ecosystems. It should be fixed upstream, then patched here until the fix is released. If there is a python-ninja, it should be a repacking of the actual python ninja package. If someone actually does need the Python package with jobserver support, they should be able to require it. These packages do not, but just have a faulty discovery / usage of ninja only from the package. Trying to hack around the problem is just going to cause problems later. You can't delete the fake package once it's released. |
Hi friend! We really, really, really appreciate that you have taken the time to make a PR on In an effort to maintain this repository and increase the signal-to-noise for open PRs, the maintainers of If you'd like to keep it open, please comment/push and we will be happy to oblige! Note that very old PRs will likely need to be rebased on Cheers and thank you for contributing to this community effort! |
Hi again! About a month ago, we commented on this PR saying it would be closed in another month if it was still inactive. It has been a month and so now it is being closed. Thank you so much for making it in the first place and contributing to the community project that is Cheers and have a great day! |
Ninja is a small build system with a focus on speed. This is the Python build. Refer to https://github.com/scikit-build/ninja-python-distributions.
Fixes conda-forge/ninja-feedstock#26, fixes scikit-build/ninja-python-distributions#42
Checklist
url
) rather than a repo (e.g.git_url
) is used in your recipe (see here for more details).