-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
numpy 2.0.0rc migration #5790
numpy 2.0.0rc migration #5790
Conversation
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 ( |
Argh, damn. If we set
|
I cannot get this to work for pythran despite hacking around on conda-smithy. The combination of having several migrations use However we can't avoid The other issue is that AFAICT Perhaps that difference can be exploited in a different way though - if we change the global pinning to zip in |
Another alternative of course would be to drop python 3.8, see #5013 |
@conda-forge/core, we should come to a decision here what we want to do. AFAICT, we could either:
I doubt that 4. is going to materialize, 3. is IMO a way too big hammer, but 1. & 2. should work. |
I feel like this is making a case for dropping Python 3.8. I'll comment my support over there. |
This seems like a reasonable thing to do. |
I had thought I had followed the python 3.12 rollout, but I'm not aware of what kind of channel_sources:
- conda-forge
+- conda-forge
+- conda-forge/label/python_rc,conda-forge
+- conda-forge
+- conda-forge
zip_keys:
- - python
- numpy
+ - channel_sources so I don't see the problem there. AFAICT, it would be harmless (i.e. no functional change) to change the global pinning to do channel_sources:
- conda-forge
+ - conda-forge
+ - conda-forge
+ - conda-forge
zip_keys:
- - python
- python_impl
- numpy
+ - channel_sources which would allow us to override |
See https://github.com/conda-forge/python-feedstock/blob/46e4991703e49cf75833699d42d6605147d31aa6/recipe/meta.yaml#L185-L187 and https://github.com/conda-forge/_python_rc-feedstock Only the |
OK, thanks for that refresher! I opened conda-forge/staged-recipes#26188 for creating |
The issues here should have been solved now AFAICT. conda-forge/conda-smithy#1911 could be solved without changes to smithy (see 0aeca11), and the question about how to deal with the channel_sources vs. strict channel priority vs. python 3.8 vs. smithy constraints has also been solved by following the same approach as for the python 3.12rc migration (see conda-forge/staged-recipes#26188 and conda-forge/numpy-feedstock#314). Once we merge the numpy PR, we can also re-test this in conda-forge/pythran-feedstock#84, but AFAICT we're basically ready now. |
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 Axel! 🙏
Had a couple thoughts on the message to maintainers below
To provide some context on some of the suggestions above, think the main issue is this is a lot of text for maintainers to read and this going to show up in a lot of feedstocks. Would like to see if we can find a balance between informative and overwhelming Suppose one could say all of the words written currently need to be there and maybe that is true. Though suspect we can condense this a bit more. The more succinct it becomes the better chance that people will read and understand it Made an attempt to do that, but of course there are many ways to accomplish this. Please feel free to make other changes that accomplish this |
I agree with the sentiment, though I do think the information is way more accessible to maintainers if it's already described in the PR itself, rather than having to go hunt around for it. Secondly, we're already providing a TL;DR if someone doesn't want to read the whole thing, so I don't really buy the "overwhelmed" bit. If maintainers don't read the PR and just click merge on a green CI, there's not much we can do, and should be fine. If they take 2min to read it, even better. So while I agree we should strive for succinctness, we also shouldn't go to the point where the information provided becomes inaccurate. And I think the information provided does have a significant value add for those wanting to understand what's happening (which I wager is higher than those who are scared of by a few paragraphs of text). |
* [ ] Match run-requirements for numpy (i.e. check upstream `pyproject.toml` or however the project specifies numpy compatibility) | ||
* If upstream is not yet compatible with numpy 2.0, add `numpy <2` upper bound under `run:`. | ||
* If upstream is already compatible with numpy 2.0, nothing else should be necessary in most cases. | ||
* If upstream requires a minimum numpy version newer than 1.19, you can add `numpy >=x.y` under `run:`. |
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.
I'm not sure how much we want to talk about lower bounds, because this is often not necessarily correct upstream either. But I think we need to mention it
@rgommers, regarding not mentioning |
OK, I'm going to merge this to get the ball rolling. It's very easy to adapt the commit message to something else afterwards, while the migration is running - if you feel something can be improved or should be changed, please comment or open a PR! :) |
Thanks Axel! 🙏 Appreciate you taking the time to revise the message a bit. Communication of this kind is always tricky and I'm sure we will learn from maintainers' feedback Though agree it is better to get this moving than perfect the message. Thanks for doing that 🙂 |
python: | ||
- 3.8.* *_cpython | ||
- 3.9.* *_cpython | ||
- 3.10.* *_cpython | ||
- 3.11.* *_cpython |
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.
So I just realized that having this bit in the migrator is a problem, because it considers all python-feedstocks as up for migration. I'll try to reduce that.
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.
Fixed in 1aef67b (after testing that the rerender in scipy didn't change)
Yes, the build will fail because the C API in question will not be exposed in the numpy headers. I would not expect this to ever happen in conda-forge feedstocks, because it won't be possible to build wheels for PyPI if there is such a problem in the sources of a package. The fix has to be at the package source level. |
I don't understand how that's related to PyPI? If a package specifies |
Then I misunderstood your question. If it uses the new C API features and sets If that's still not clear, can you please make the question more precise? |
That's what my question boiled down to. It's possible that packages/feedstocks are specifying |
Again, this is not possible. The build will fail, since the newer C API features are not exposed unless |
How is that not possible in a pre-2.0 world? If numpy 1.24 is available at build time, there's no need for setting the macro AFAICT. |
The whole mechanism was only introduced in numpy 1.25, so for numpy 1.24 things are as they always were. That's completely unrelated to either Also, aside from it being unrelated: such a build config would have started failing in the package's CI as soon as numpy 1.25 became available, so it would have been fixed a long time ago. It would be nice at this point to either see a real-world issue (because this has been entirely hypothetical for weeks now) or a very very clear description of the problem. |
I'm thinking / concerned about the following scenario:
In that case, if we now update to build against numpy 2.0 but for the 1.19 C API, things would fail (AFAICT). I'm asking what steps we should recommend to such feedstocks to solve eventual build issues due to the above, in the face of the upcoming migration PRs to such feedstocks. |
So I'd say:
I propose we close the case here, and only revisit it if and when something actually materializes. There's no point speculating here. |
@@ -33,6 +33,8 @@ python: | |||
- 3.12.* *_cpython | |||
# additional entries to add for zip_keys | |||
numpy: | |||
- 1.26 | |||
- 2.0 |
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.
@h-vetinari This will break all feedstocks with Python 3.12. Please revert.
Cc @hmaarrfk
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.
How so? I've tested this with a bunch of feedstocks building for 3.12 successfully.
I'm happy to revert of course, but can someone describe (or link to) the breakage?
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.
Ah nevermind, I understand what you mean. It changes py312 builds even before the migrator comes by. 😑
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.
That's an interesting wrinkle. I'm not sure how we can then do the numpy migration for 3.12...
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.
Done: 09f6263
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.
I've continued the discussion how to fix this in conda-forge/conda-forge.github.io#1997
The comment formatting here gets completely busted due to this... |
Fix in regro/cf-scripts#2538 |
This follows conda-forge/conda-forge.github.io#1997 & discussion in core this week.
Previously...
There are a couple of problems, most of which stem from the existing zip between
{numpy, python, python_impl}
. Due to this zip, wanting to build for both numpy 1.x & numpy 2.0 means we have to duplicate all keys involved in the zip. I've been testing this on the scipy-feedstock, see conda-forge/scipy-feedstock@5c8599d.However, the immediate problems that arise are:
channel_sources
does not get populated correctly despite being update in the migrator (am I missing something...?)operation: key_add
can apparently only add one key, so - after the necessary duplication due to the zip - the changes inpython312.yaml
andpypy38.yaml
end up dropping the existing 1.x buildsadditional_zip_keys: channel_sources
(like for python 3.12.0rc) leads toRecursionError: maximum recursion depth exceeded
in smithy (see conda-forge/scipy-feedstock@22d530f).After discussion in that issue, it seems we're tending towards not dealing with duplicating all numpy builds into 1.x & 2.0rc1, but rather building everything against 2.0rc1 directly (problems with that outlined below).
However, one issue from the original approach still remains:
Despite setting
channel_sources
in the migrators unequivocally, it ends up getting ignored by conda-smithy. I have a local smithy fix that I'm testing in conda-forge/scipy-feedstock#274 together with the migrator state from this PR.